I am trying to change the appearance field based on a conditional statement. For example, if selected(${more_users},"no") then set the appearance to hidden, else set it to the default value. aside from that I don't know if placing that statement on the appearance field is correct. If not please guide me.
This is what I came up with, not sure if I'm on the right path.
if(${more_users} = "Yes", "", "hidden")
Solved! Go to Solution.
What you are looking for is the relevant or body::esri::visible fields. Just put your statement in one of those two fields.
E.g., if(selected(${more_users},'Yes'), 'yes', '')
Edit. Forgot to give a general explanation of the difference between these fields.
Field | General explanation |
Relevant | While hidden, a field ceases to exist. E.g., User input will disappear and reset to default. Also, a field hidden by 'relevant' that is required will be ignored when submitting. |
body::esri::visible | While hidden, the field still exists. E.g., User input will be maintained. A field hidden by 'body::esri::visible' that is required must contain data. |
Actually you need a true statement, you do not use yes as the return. Just selected(${more_users},'Yes') does the trick. yes is just for the user drop down but it is any true or false statement. Using yes or '' does not always work.
What you are looking for is the relevant or body::esri::visible fields. Just put your statement in one of those two fields.
E.g., if(selected(${more_users},'Yes'), 'yes', '')
Edit. Forgot to give a general explanation of the difference between these fields.
Field | General explanation |
Relevant | While hidden, a field ceases to exist. E.g., User input will disappear and reset to default. Also, a field hidden by 'relevant' that is required will be ignored when submitting. |
body::esri::visible | While hidden, the field still exists. E.g., User input will be maintained. A field hidden by 'body::esri::visible' that is required must contain data. |
Actually you need a true statement, you do not use yes as the return. Just selected(${more_users},'Yes') does the trick. yes is just for the user drop down but it is any true or false statement. Using yes or '' does not always work.
Right. I usually just copy-paste IF statements around because they work in more than one type of field.
It hasn't been my experience for this to fail. Do you have a specific scenario, or just something you have seen from time-to-time?