Using the column Constraint

Erike
New Member

Im trying to ask the user to fill a text field if a set of given conditions.

I was nor working properly for me, so I reduced the complexity of the expression to a very simple one to isolate the issue.

I have defined it as follows:

IF(
ISBLANK([_THIS]),

false,
true)

3X_e_4_e494537806b5b53f75b2e6568a924d50e06f49ea.png

When clicked on Save, the expected behaviour is:

if the field is empty the message must be displayed and not saved.
if not, the record must be saved

Well, it saves allways the record.

Seems that ISBLANK is providing an unexpected result. So, for a second column, I calculated it based on the value of the first column.

IF(
ISBLANK([recepcionNotaTransportes]),
true,
false)
3X_f_9_f99a3f18a3b152f2a52666b01705b821f1a37e55.png

What I see is that the second column provides a true or false value if the first column was empty or not.

But the first column was not displaying the error message if it was empty

What am I missing?

Solved Solved
0 11 423
1 ACCEPTED SOLUTION

No. The Valid If expression isnโ€™t even evaluated if the column value is blank.

View solution in original post

11 REPLIES 11

I believe the behavior you are trying to implement is that the column should not be blank during data entry before form save.

If so, as per my understanding, โ€œRequired_Ifโ€ constraint is basically used to check that behavior of the column.

Following are the two excerpts from the help article on the โ€œRequired_Ifโ€ constraint

  1. The Required_If column constraint may be used to require a column value of a row be present before the row may be saved. If a required column value is blank, the row cannot be saved.

  2. The Required_If column constraint is a Yes/No expression: if the expression evaluates as TRUE, the column value may not be blank; if FALSE, the column value may be blank.

I believe the โ€œvalid_ifโ€ constraint checks validity of the column value once the column is non-blank

Thanks a lot for your answer.

You are right in what you mention related to Required_if. I could solve it with it.

The issue is that I requiere the column to be filled on some conditions and provide a message to the user that makes sense to him.

I didnโ€™t include the other conditions to focus just on what seems is not working (the behaviour if the column is left empty).

With Requiered_if I could include the other conditions. But if would reject the user input providing a generic message.

Thats why I insist on using Valid_if instead of Required_if. Because Valid_if allows to provide a customised message to the user.

Besides my particular business need, I imagine that the condition for Valid_if should work in any case.

Thank you. If you could mention more details on your requirement, the community could suggest a combination of Valid_if and Required_if to meet it, if it is feasible.

Your current condition purely checks the blank/not blank value and hence may not work with โ€œvalid_ifโ€

Hello again

You said โ€œYour current condition purely checks the blank/not blank value and hence may not work with โ€œvalid_ifโ€โ€

Thats the point. Why blank/not blank may not work with โ€œvalid_ifโ€?

I appreciate your point. I believe that is an aspect of implementation in a platform. As per my understanding, it could be a matter of separating behavior between โ€œRequired_ifโ€ and "Valid_ifโ€™

I believe someone from AppSheet team or some other community member could give more insights into this.

You may also wish to consider raising a feature request to implement the behavior.

Hola Erike, vi en tu captura de pantalla que hablas espaรฑol, asรญ que me tomarรฉ la libertad de hablarte en espaรฑol jeje, el tema con usar el โ€œvalid_ifโ€ con una columna en blanco es que el valid_if es comรบnmente utilizado para evaluar un valor o texto cargado por el usuario, entonces si el usuario lo deja en blanco no hay nada para que la funciรณn verifique, por lo que tendrias que hacer que llenar esa columna sea obligatorio, para solucionarlo podrรญas utilizar un valor inicial, o un par de botones incluso, dependiendo de lo que quieras lograr

Hola Rafael. Gracias por tu respuesta.
Disculpa que no haya contestado nada, porqie no me di cuenta de ella hasta ahora.

Justo es lo que comentรณ Steve. Que el valid_if ni siquiera se llega a evaluar. Por tanto la lรณgica que pongas dentro es inutil (en este caso).

La soluciรณn que sugieres de un valor inicial, puede ser una muy buena idea.

No hay problema @Erike, no te olvides de contarnos el desenlace ! o en todo caso si te surge alguna duda.

Request you to note just in case it helps.

Please note that you could customize even the โ€œThis entry is requiredโ€ message.
However, for these system text messages, customization is more global than local in that it is not row-based but view or user or app-based.

Thank you very much @Suvrutt_Gurjar !!

The issue with it is, as you said, that this customization is for the whole app and not for the specific context where the issue happens.

Coming back to the issue. Does isblank work with valid_if? Seems strange is doesnโ€™t work when its working with compute

No. The Valid If expression isnโ€™t even evaluated if the column value is blank.

Top Labels in this Space