Hello,
It may be helpful if you paste the code you tried already in your original post as it may not be working for a simple correctable reason. I'm assuming that you are using ArcGIS Online.
Given that you have the two following fields:
- hw_completed
- hw_not_completed_reason
The visibility expression assigned to hw_not_completed_reason field looks like the following:
if (Lower($feature.hw_completed) != 'yes') { return true };
return false;
/*
Constraints (like visibility, requiredness, & editability) need to return either true or false (aka Boolean).
This expression returns true (visible) if the users response is anything other than 'Yes' or 'yes', indicating that the homework was not completed.
Otherwise, it returns false (not visible) because the homework was completed, so no reason is need.
*/
Here I created two text fields to support the example:
I clicked the gear icon next to visibility (found in the logic section after selecting the field "hw_not_completed_reason"). Then clicked add new expression. Then, near the bottom right corner I clicked the "Launch Arcade Editor" Option. Then I gave my expression the name "vis_hw_not_completed_reason" based on the my field's name. Then I wrote the expression and saved it.
- Justin Reynolds, PE