Hide question group conditionally

272
2
Jump to solution
11-24-2021 01:57 PM
Jordi-Monk-Developer
New Contributor III

Hello,

Within a survey (being authored through Connect), we have a question group with a single geoshape question. The question group has the 'field-list' appearance. We want to hide this question group if the answer to a previous question (${geom_edit_desired}) is 'no', and for that we use the 'relevant' column with the following value:

 

${geom_edit_desired}='yes'

 

The survey will ALWAYS be opened either in copy or in edit modes. 

 

This is our problem:

  • When a survey is opened, if the user decides not to edit the existing geometry, the geoshape question is not 'relevant' (is hidden from the survey), BUT in doing so, the survey writes NULL to the geometry field. In other words, we lost the geometry from the feature. If then the same or other user wants to open this survey back (be it in edit or copy modes), there is no geometry to be edited anymore.

In other words, we need to conditionally hide the geoshape question while at the same time maintaining the existing feature geometry.


What I have tried (to no avail):

  • Populate the 'appearance' column conditionally:

 

if(${geom_edit_desired}='yes', 'field-list', 'hidden'}

 

  • Duplicate the geoshape question, with an appearance of 'hidden', and then attempt to populate the 'bind::esri:fieldType' column conditionally (the idea being to send to the feature layer one or the other of the 2 geoshape questions).

 

if(${geom_edit_desired}='yes', 'null', '')

 

  •  Inserting a 'calculate' question, and evaluating there the value to be used in the 'appearance' column of the geoshape question:

 

// In the 'calculate' question:
if(${geom_edit_desired}='yes', 'field-list', 'hidden')
// And then in the 'appearance' column of the geoshape question:
${<calculate_apperance_question>}

 

 

Thank you.

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Notable Contributor

I think what you want here is the new way to hide using the body::esri:visible column.  It works like relevant but does not set to null - it only hides it.

Give that a shot

View solution in original post

2 Replies
DougBrowning
MVP Notable Contributor

I think what you want here is the new way to hide using the body::esri:visible column.  It works like relevant but does not set to null - it only hides it.

Give that a shot

Jordi-Monk-Developer
New Contributor III

Yes, yes, and yes! That worked. Thank you!

0 Kudos