Select to view content in your preferred language

Fields with dynamic visibility not showing in Map Viewer

190
5
a month ago
KatieQuantrell
Occasional Contributor

Hi, 

I am setting up a Field Maps form through the Field Maps Designer and have two field that have dynamic visibility set. On start up both fields should be shown and then once one is populated the other should be hidden (as only one of the fields needs to be populated by the user). When I view the form in field maps this works fine, however when viewing the form in Map Viewer neither of the fields are shown when the form is opened. Meaning no data can be entered to these fields.

Has anyone else had issues with dynamic visibility for fields in Map Viewer? 

Any help would be really appreciated. Thank you

0 Kudos
5 Replies
RhettZufelt
MVP Notable Contributor

You didn't show what code you are using for this, but a quick test shows it working for me with IsEmpty().

 

IsEmpty($feature.Description)

 

I put this on the MUTCDcode field.

and 

 

IsEmpty($feature.MUTCDcode)

 

on the Description field.

This way, when one of them is populated, the other is hidden from the form.

working in both Field Maps app and Map Viewer in AGOL.

R_

0 Kudos
KatieQuantrell
Occasional Contributor

Many thanks for your reply. 

Unfortunately what you have outlined above is how I have also set these fields up, but neither field is showing in Map Viewer in AGOL even though they show correctly in the Field Maps app.

I have also set up a separate test map/layer with just two fields as above and get the same result. 

If anyone dose have any advice on this I'd be really grateful.

Many thanks

0 Kudos
RhettZufelt
MVP Notable Contributor

I see this if I attach the IsEmpty() code to fields that have a default value.

Do you have a default value set on either of the field(s)?  If so, suspect it is getting populated when you open the edit form, so they are not empty, and get hidden.

R_

0 Kudos
KatieQuantrell
Occasional Contributor

No, no defaults set. 

I tested removing the dynamic visibility from one of the fields (but leaving it still set on the other) and if I do this both fields do show up initially, with the field with the dynamic visibility still set then being hidden when the other field is populated (as is expected). So don't think there's any hidden defaults etc. 

It just seems really strange (and really frustrating!)

Many thanks again for any help,

0 Kudos
KatieQuantrell
Occasional Contributor

Hi,

Just wanted to update this to say I have now found the cause/solution to this (phew!)

Within Field Maps Designer under the 'Form builder' panel there is a 'Form Settings' section that has a 'Preserve values when fields are hidden with conditional visibility rules' tick box. This was unticked by default. Ticking this however has meant the fields with dynamic visibility set as above are now working as expected in both Map Viewer as well as Field Maps. 

Really hope this helps anyone else who might come across the same issue. 

Thanks, Katie

 

0 Kudos