Dependent dropdown + Required/Required_If not working

Greetings,

Iโ€™ve created an app with Refs and a dependent dropdown list (fields โ€œImobiliรกriaโ€ e โ€œCorretorโ€) - the field โ€œCorretorโ€ shows a list of employees depending on the chosen โ€œImobiliรกriaโ€. The problem is that those two fields were configured to be โ€œRequiredโ€ but my employees have been able to save the form without filling those two fields.

3X_2_6_264891172c25157a459e82eba1012aa90cfd0e9d.png

Iโ€™ve tried to create many โ€œRequired_Ifโ€ and โ€œValid_Ifโ€ formulas as well, but still no successโ€ฆ

Is there something that Iโ€™m missing?
Thanks in advance.

0 6 537
6 REPLIES 6

This might happen if the required field is not shown - because AppSheet only enforces the required nature of a column when itโ€™s shown.

  • If your valid if formula would result in 0 options, the field disappears - which then removes the required state for that field.

There are a couple of solutions, but my favorite is the following:

  • Apply the require formula on a different field, one that will always be shown.
    • Sometimes I add another virtual column to the table, thatโ€™s a LongText type with a formula something like this:

IFS(AND(
ISNOTBLANK([Column1]),
ISNOTBLANK([Column2]),
ISBLANK([Column3])
),
โ€œMake sure you fill all the fieldsโ€)

I would actually go into much more detail, providing exact instructions on why the field isnโ€™t working - but you get the drift I hope.

You can then apply a valid if formula to your new โ€œalertโ€ column:

isblank([_this])

where if that column has any value, it will not let the user save - but as long as itโ€™s blank (which means that all criteria and things are as they should be), then a user wouldnโ€™t even know it was there.

First of all, thanks for your response!

This might happen if the required field is not shown - because AppSheet only enforces the required nature of a column when itโ€™s shown.

I did some testing and thatโ€™s exactly the problem!

Apply the require formula on a different field, one that will always be shown.

I do have fields that are always shown (not a virtual column), but I wasnโ€™t able to create a require formula that demands filling the two fields - โ€œCorretorโ€ and โ€œImobiliรกriaโ€ - that I was having problems with.
I was using a DateTime field - โ€œData e horรกrio de retiradaโ€ - that already has a formula (the app automatically fills this field) to test some require formulas, but I still had no luckโ€ฆ

3X_a_4_a4f89e3744207fd813acf0d431b9fd3e7b570ba3.png

At first I would like to try to resolve this issue without using and extra virtual columns. Do you have any ideas/suggestions of require formulas that would work?

Thanks!

Put your valid if formula here, something like this:

AND(
{YOUR_PREVIOUS_CRITERIA},
isnotblank([Column_to_Enforce])
)

This will keep the original validation youโ€™ve got, while throwing into the mix the requirement that another field in the table have a value as well.


If you want to get fancy, you can throw in a valid if error message that tells people whatโ€™s wrong so they know what to fix.

That works, but when someone attempts to save the entry without filling those two fields it shows โ€œInvalid entry - Essa entrada รฉ invรกlida, in portugueseโ€. The problem Iโ€™m facing now is that once that happens the fields โ€œCorretorโ€ and โ€œImobiliรกriaโ€ disappear from the form, so the user has to hit โ€œCancelโ€ and start over.

3X_2_f_2f81775b159d16e4e08db9b951fde72a4f0adac8.png

Is there a way to continue to show the other fields after the entry is invalid?

Thanks!

I would think this has somethin to do with your show if formulas.

Iโ€™m not using any โ€œShow_Ifโ€ formulas. Would there be any formulas that I could use to force the fields to be shown?

Top Labels in this Space