Select to view content in your preferred language

Dynamic List with search() Appearance in select_multiple question only loads for First Repeat Entry in Web Form

175
2
Jump to solution
4 weeks ago
JoseBarrios1
Frequent Contributor

Hi everyone,

I'm working on a survey that includes a select_multiple question inside a repeat. The choices for this question are populated dynamically using the search() appearance. Everything works as expected on both the mobile and desktop Survey123 apps—each repeat entry loads the dynamic list correctly.

However, when I publish the survey as a web form, the dynamic list only loads for the first repeat entry. For all subsequent entries within the repeat, the list does not load at all.  Even when leaving the first repeat entry empty, the others are still not loading the list in the web form.

Here are a few details about my setup:

  • The select_multiple uses the search() appearance to query a hosted table.

  • No questions in the repeat are marked as required.

  • The survey is embedded in Experience Builder.

Does anyone know if this a known limitation of the web form when using dynamic lists in repeats? Could it be a bug, or  an issue with how I’ve written the expression? 

Any insight, workarounds, or suggestions would be greatly appreciated!

Thanks in advance,

JB

0 Kudos
1 Solution

Accepted Solutions
JoseBarrios1
Frequent Contributor

Hi Neal,

Thanks once again for your suggestions and for taking the time to look into my issue with the search() appearance used to populate a dynamic list. I did try your suggested approach of calculating the URL outside the repeat and referencing it inside, as well as making it relevant to another question—but unfortunately, that didn’t resolve the issue in my case. I was able to find a solution, though, and I wanted to share it in case it helps others facing the same problem.

The Problem: The issue occurred when I published the survey as a web form. I was using a dynamic list with the search() appearance inside a repeat (see expression below). The list would load correctly for the first repeat entry, but for all subsequent entries, the list would not load at all—even if the first entry was left blank. Interestingly, everything worked perfectly in both the mobile and desktop Survey123 apps, so the issue seemed specific to the web form.

Original (NOT working) Expression: search("ParticipantsTable?url=https://services.arcgis.com/..../FeatureServer/0&orderByFields=PaticipantID",'matches','Station_ID',${stationID})

 

My solution: After testing several workflows, I discovered that the issue wasn’t with how the URL was being loaded, but rather with the filter parameters used at the end of the search() expression. In my case, the list inside the repeat was filtered by a stationID selected in a previous question outside the repeat.

My fix was to copy that stationID value into a hidden text question (or calculation) inside the repeat. I then used that copied value (copyStation_ID) as the filter parameter in the search() expression (see working expression below). That did the trick!

Working Expression: search("ParticipantsTable?url=https://services.arcgis.com/..../FeatureServer/0&orderByFields=PaticipantID",'matches','Station_ID',${copyStation_ID})

 

See attached sample of the workflow for reference!

Hopefully this helps anyone else encountering the same issue—at least for web forms.

Thanks,

JB

View solution in original post

2 Replies
Neal_t_k
Frequent Contributor

I had something similar happen once but it was not an integral part so I never solved it, also it was only the 2nd repeat, the 1st, 3rd and so on worked as intended. 

A couple trouble shooting questions.

- If you go to the 3rd repeat and then back to the 2nd, do the lists populate?

-Are you calling in the url inside each repeat i.e. multiple times? I am assuming this is the same form as your previous question, something you could try, not sure how it would work, but putting the calculate for the url once outside of the repeat, and then inside each repeat call that question. essentially so you are only having the url called once.

Just some thoughts.  If you could share an example of your xlsx it might help.

JoseBarrios1
Frequent Contributor

Hi Neal,

Thanks once again for your suggestions and for taking the time to look into my issue with the search() appearance used to populate a dynamic list. I did try your suggested approach of calculating the URL outside the repeat and referencing it inside, as well as making it relevant to another question—but unfortunately, that didn’t resolve the issue in my case. I was able to find a solution, though, and I wanted to share it in case it helps others facing the same problem.

The Problem: The issue occurred when I published the survey as a web form. I was using a dynamic list with the search() appearance inside a repeat (see expression below). The list would load correctly for the first repeat entry, but for all subsequent entries, the list would not load at all—even if the first entry was left blank. Interestingly, everything worked perfectly in both the mobile and desktop Survey123 apps, so the issue seemed specific to the web form.

Original (NOT working) Expression: search("ParticipantsTable?url=https://services.arcgis.com/..../FeatureServer/0&orderByFields=PaticipantID",'matches','Station_ID',${stationID})

 

My solution: After testing several workflows, I discovered that the issue wasn’t with how the URL was being loaded, but rather with the filter parameters used at the end of the search() expression. In my case, the list inside the repeat was filtered by a stationID selected in a previous question outside the repeat.

My fix was to copy that stationID value into a hidden text question (or calculation) inside the repeat. I then used that copied value (copyStation_ID) as the filter parameter in the search() expression (see working expression below). That did the trick!

Working Expression: search("ParticipantsTable?url=https://services.arcgis.com/..../FeatureServer/0&orderByFields=PaticipantID",'matches','Station_ID',${copyStation_ID})

 

See attached sample of the workflow for reference!

Hopefully this helps anyone else encountering the same issue—at least for web forms.

Thanks,

JB