All blank or all populated fields before Submit allowed

Noob question here, please forgive if this is uber simple to resolve:

I have 3 fields: Tenant Email, Tenancy Start, Tenancy End (along with a bunch of other fields).

I need these three to either be ALL populated with values, or NONE of them populated before an edit or add can be Submitted.

If I make these Required fields, this covers the need for them to be ALL populated, but how can I allow Submit if ALL 3 are empty?

If just one or two of any of the three fields is blank I want to display a warning and not allow Submit.

Your patience and awesomeness is appreciated.

To clarify, these aren’t the only 3 fields in the form, correct?

Need to use a bit of smoke and mirrors. Assuming these three fields are placed one after the other:

  1. create two containers: one that has all 3 fields required; one that has none of them required
  2. Add visibility conditions to each container:
    — The container with the 3 required fields has a visibility condition to appear if field1 is not empty OR if field2 is not empty OR if field3 is not empty
    — The container with the 3 non-required fields has a visibility condition to appear if field1 is empty AND if field2 is empty AND if field3 is empty
1 Like

Correct. The form has about 8 fields. The other fields can be managed individually (Required or non-Required) it is just this grouping of 3 that I need to manage together.

I think you’re on to something here! Please bear with me as I attempt to put this into place and confirm your cunning plan.

1 Like

I think this is very close to what I want, however the container with the Required fields is showing when all are empty (I can confirm the fields are blank in the table), and the container of non-Requireds is hidden. Seems the Visibility rules are working backwards?

Hm… the logic I specified should be right. Are you 100% positive there’s isn’t a hidden value in those date pickers?

I agree, the logic sounds right. The data for that row contains empty fields.

If you have an epiphany, please let me know, otherwise I’ll keep playing and will post the solution once I find it.

Edit: I have the Non-Required showing now when ALL empty. I had not set the Default Values. Uncertain why this triggered the All Empty criteria but that seemed to work. Filling in one field through does not trigger the Required now though.

Silly thought: Could it be that the Visibility criteria are looking at the values in the database, but when filling in the form the fields are not written to the database until I press Submit? Meaning that the database values have not yet been updated and therefore not triggering the Visibility criteria as the data hasn’t written to the table yet?

This is correct and expected behavior. Entries live in no-man’s-land until submitted, but form logic will still honor it. Let me see if I can reproduce.

Seems to work :man_shrugging:

I just need you to know that you, good Sir, are a Genius!

This video really helped. And the thing that helped? You are using a Container, and I was using a Form Container. Seems the Form Container, as I surmised and you confirmed, leaves the data changes in limbo and therefore not readable by the Visibility criteria, whereas the Container has direct access to the data to and from the table.

Thanks so much for the help and patience with a noob.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.