Select to view content in your preferred language

Required Field based on previous selection

265
3
08-22-2024 10:33 AM
ModernElectric
Frequent Contributor

I am in the process of revamping and redesigning one of our more complex forms. Need to figure out if the user makes a specific selection, the following question becomes a required field.

Example:

ModernElectric_0-1724347878963.png

If the user selects one of the 3 options marked with an arrow, the OTHER (EXPLAIN) free-entry section becomes required before moving on to the next page. However, if they select reconnect, the OTHER section doesnt become required. Also, Is there a way that IF they select one of those options, that field could go from minimized to automatically maximize indicating the user needs to fill it out.

Yes, multiple step multi-question problem I'm working on.

Appreciate any feedback or assistance. 

0 Kudos
3 Replies
RobertAnderson3
MVP Regular Contributor

Yes this is possible, you can add expressions in both the body::esri:visible (or relevant, but I've started to prefer the former) and required fields.

In this case since it's only one option that means it should not be shown or required I would do something like ${reason}!='reconnect' in those two fields.

0 Kudos
ModernElectric
Frequent Contributor

@RobertAnderson3 

Thank you for the feedback. I was able to write the code using a select or statement in the required field. Follow-up question, if the selection is selected, is it possible for the group compact to auto expand?

So if the user selects structure fire, it meets the selected requirements, and the description automatically expands to the multi-line text entry making the user more aware they have more data to enter.

ModernElectric_0-1724353586157.png

 

0 Kudos
RobertAnderson3
MVP Regular Contributor

No problem!

Unfortunately I believe expressions cannot be used in the appearance column which is where the collapsed or not state of a group is set up. You can set a group as visible or not using the same columns I mentioned above though.

 

0 Kudos