In Survey123 Connect, I designed a survey that asks users for the number of locations that they need to collect data. Based on their response, different sets of questions are displayed. If the user select the option of less than 10 locations, a specific set of questions appears. If they select 10 or more locations, another set of questions is shown. I've used the body::esri:visible column to control this visibility. The logic works correctly when I test and update the survey123 connect app on my system but when I publish the survey to our portal the logic does not work for '10 or more' locations and it is not displaying as expected and they are shown for even if users select less than 10 locations. The questions related to the more than 10 locations are within a repeat. In the repeat there are two additional questions that should always be visible, regardless of the location count.
Looks like you are checking for more than 10 and less than 10 on those last 3 lines. that is not possible to be both at the same time.
That was a wrong screenshot. the last three lines do not have anything in the visible column. please check this screenshot. I published the survey again and now the survey lines from 39 to 42 that should be shown only if users select more than 10 locations while they are shown for the less than 10 locations as well.
can you show the choices list also
only thing I can think of is your note fields have no field names. try that.
Since the visibility check is using a select_one type question I would try formatting body::esri::visible formula as:
selected(${number_of_locations}, 'less_than_ten_locations')
and
selected(${number_of_locations}, 'more_than_ten_locations')
That is the more robust way to check if it was selected. I've run into it where the ${question} = 'choice' method doesn't work right from time to time.
FYI, line 33 is a begin repeat with body::esri::visible containing a formula and line 35 is a question nested in that repeat without a formula in the visible column. If you only want that repeat to show when less than ten locations is selected you can drop the visibility check for the nested questions. However if you do want the question on line 35 to show regardless you'll need to delete the visibility check on the repeat.
Yes I am wondering on that order there also. I have seen where the visible goes in a weird order. Good call on that. I also wonder why poster is not using relevant?
I use visible sometimes because it affects how the survey appears. If you use relevant, you have an extra step in the form by having to click the + to start the first repeat. If you use visible, the questions are visible as soon as the condition is met, and you only need to hit the + for additional ones beyond the first.
Thanks, do you know why when I use the visible, the lines are shown for the whole survey not just for the more than 10 locations? Because of the users of this form I prefer using visible rather than relevant