I'm populating a list of values from select_one in a repeat (List A), then using that list to dynamically filter a select list (List B) after the repeat. Both draw from the same choice list_name.
I'm using the regex() method outlined here to create a dynamic select list via the choice_filter:
https://community.esri.com/t5/arcgis-survey123-questions/dynamic-choice-filter-created-from-repeat-s...
Using selected() also works.
This seems to work flawlessly in S123 Connect and the Mobile app. However, in the Web app, there may be two bugs:
1. The dynamic list (List B) does not show the checkboxes. Regardless, you can select an answer. If you put this question in a repeat (change group to repeat) and open a new record after completing List A, the checkboxes will display. If you add a value to List A, the checkboxes then disappear on that record as well.
2. If you add a value to the value list (List A), all selections in List B are deleted.
Although I'm using a select_multiple for List B, the same issues arise with select_one. Otherwise, I've simplified this example as much as possible (probably to the point where it doesn't make sense, but List B is inside a repeat with a bunch of other questions and is functionally linking the two repeats with a many-to-many relationship.)
Any workarounds? Unfortunately, this form would be used in the Web app.
Solved! Go to Solution.
Okay, I found a workaround. I'll share in case anyone else comes up with a reason to emulate.
After looking at the JSON submitted in a S123 Connect example, I discovered that my attempt with join() resulted in a list variable like:
"list": "1,2,3"
Conversely, a multiselect question resulted in a list variable like
"list": [1,2,3]
The webapp didn't play well with the first format when using a choice_filter like "selected(${list}, name)" (where name is referring to the 'name' column on the choices tab).
So, in order to get that properly formatted list, I added another select_multiple question with the list in question, with a hidden appearance and a calculation of ${list}. That new field could then be used on the final list (List B above) as the choice filter.
The only hang up I found was that if the 2nd repeat I was using had specific relevant condition, it caused Issue #1 above to arise again. Some relevant statements were fine, others, not so much.
I doubt that's as clear as it needs to be. Drop a note if you need an example.
Okay, I found a workaround. I'll share in case anyone else comes up with a reason to emulate.
After looking at the JSON submitted in a S123 Connect example, I discovered that my attempt with join() resulted in a list variable like:
"list": "1,2,3"
Conversely, a multiselect question resulted in a list variable like
"list": [1,2,3]
The webapp didn't play well with the first format when using a choice_filter like "selected(${list}, name)" (where name is referring to the 'name' column on the choices tab).
So, in order to get that properly formatted list, I added another select_multiple question with the list in question, with a hidden appearance and a calculation of ${list}. That new field could then be used on the final list (List B above) as the choice filter.
The only hang up I found was that if the 2nd repeat I was using had specific relevant condition, it caused Issue #1 above to arise again. Some relevant statements were fine, others, not so much.
I doubt that's as clear as it needs to be. Drop a note if you need an example.