Make Field Required if Another Field Has a Certain Value? Condition Required-ness?

1176
4
Jump to solution
05-26-2022 06:55 PM
ArmstKP
Occasional Contributor III

I have conditional visibility setup, so users can chose a value in one dropdown and depending upon what is chosen, the next dropdown would be required if the previous dropdown was "Closed", for example?

Is this even possible to do conditional required-ness?

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Conditional requiredness is supported but not exposed yet. Currently in the web app when you check the "Required" check-box it actually writes an Arcade expression of "true". We do have plans to expose an authoring UI for writing any expression - it won't be available until this fall or winter (at the earliest).

You could check the required check-box and save the form. Then use ArcGIS Assistant to customize the referenced expression.

Find the element you'd like to make conditionally required and find the name of the expression it references. In this example, I'm making the address field required if the common name of the tree is "Red Oak".

before.png

 Then change the "expression" from "true" to whatever logic you'd like.

after.png

 Then save the changes (note in Field Maps web, it won't show the required check-box as checked - leave it as is). If you open the map in the mobile app it should work like this:

 

View solution in original post

4 Replies
Nicole_Ueberschär
Esri Regular Contributor

Hi @ArmstKP,

Beyond being required, would you still like to give the option to fill that second field even if not required? Or could you make it not relevant?

Otherwise, you can use an if function in the required field that returns 'yes' if the condition is fulfilled.

if(${first_question}='Closed','yes','')

0 Kudos
by Anonymous User
Not applicable

Conditional requiredness is supported but not exposed yet. Currently in the web app when you check the "Required" check-box it actually writes an Arcade expression of "true". We do have plans to expose an authoring UI for writing any expression - it won't be available until this fall or winter (at the earliest).

You could check the required check-box and save the form. Then use ArcGIS Assistant to customize the referenced expression.

Find the element you'd like to make conditionally required and find the name of the expression it references. In this example, I'm making the address field required if the common name of the tree is "Red Oak".

before.png

 Then change the "expression" from "true" to whatever logic you'd like.

after.png

 Then save the changes (note in Field Maps web, it won't show the required check-box as checked - leave it as is). If you open the map in the mobile app it should work like this:

 

ArmstKP
Occasional Contributor III

Aaron.  Thank you.  Your example is really helpful!

0 Kudos
ArmstKP
Occasional Contributor III

@Anonymous User I have followed your example and have successfully created conditional requiredness in my form!  Many thanks!

0 Kudos