Hello,
I'm trying to use conditional visibility in a form on a map that will be used only to modify existing features, and I've run into an issue where attributes with conditional visibility rules applied have their values deleted when visibility changes. An example of what I'm trying to do: I have a field for the number of PTZ cameras at a location, with a numeric range of 0 - 2. I then have fields for make/model/type for camera 1 and camera 2. If there are 0 PTZ cameras, I don't want any of those additional fields to show. If the number of PTZ's is 1, I want camera 1's make/model/type fields to show, but not camera 2's. Many of the features already have camera 1 data filled in for make/model/type. The problem is, if I change the value of "number of PTZ's" from 1 to 2, the conditional visibility rule briefly hides camera 1's fields, then re-shows them (along with camera 2's). That brief hiding clears the values that were entered for camera 1's make/model/type, which is not what I would expect to happen and is not great for the user. Is this expected behavior? I don't see why existing data in a field should be deleted when the field is hidden; it should just be hidden. I can get around this by just not using conditional visibility rules, but the form has a lot of fields and it's kind of an ideal use of that smart form capability. I like Field Maps so far and I'm excited about the possibilities it offers, so I'm hoping this can be changed.
Solved! Go to Solution.
HI @KevinBurke, I'm having something of a similar issue that I'm hoping you can help with.
I have a hosted feature layer(HFL) with many read only fields and several editable fields. In the "data" tab for the HFL I've set many of the fields to be 'not editable' only leaving a few for the user to be able to edit.
For the editable fields, I have a "status" field with a list domain of values... "a", "b", "c", "d". I then have date fields corresponding to each of those list values... a field for "a_date", a field for "b_date", "c_date", etc...
I want Field Maps to only show the date field that relates to its corresponding "status" value... So, if the user selects a status of "b" I only want "b_date" to show. If the user chooses "c" for the status, only show "c_date" field. I've got conditional visibility expressions for each of the date fields that read like this:
For a_date I have: $feature.Status == "a"
for b_date I have: $feature.Status == "b"
etc...
In Field Maps, when I bring up the form for a given feature and start to edit, I might see as a starting off point of "status = a"... and only "a_date" is showing... so far so good.
But if I change "status" to "b" and set the corresponding "b_date" and then submit the changes... the value for a_date that was populated prior to the edit session is now deleted (made blank). Not only that but all the "read only" field values are set back to blank as well. I've got a workaround for the read only fields at this point. I've gone through and checked the "Allow attribute editing" check box in the HFL fields list... and now those fields don't get set to blank... but I still have this issue where the date field of the previously set status gets set to blank. If I remove all the conditional visibility expressions for the date fields, things work properly, but of course now I have a bunch of date fields visible to the user where only one of them is relevant for any given "status" value, which introduces big potential for user error on inputting data.
Please help me figure out how to make this work.
-Royce
@BrendanMadden FYI, I created a new GeoNet account and will be removing the Kevin-Esri one I used in our chat history above. (Our conversation history will remain as-is) Therefore if you have further questions, please @ mention me via this user name. Thank you.