Using choice_filter with a select_multiple question.

4965
29
Jump to solution
07-17-2017 12:00 PM
AlexCarrier
New Contributor II

In my survey I have a list of structure types: Single Family, Multi Family, Other Habitable, Non Habitable, Coastal Protection, & Shore Protection. I also have a list damage types. Most damage types only apply to certain structure types. Using the choice_filter, I have been able to make it so only certain damage types appear as choices for my structure types, however this is with a select_one question type. Is it possible to have all of the damage types appear if they select more than one structure type in a select_multiple question type? 

29 Replies
DanBihari
New Contributor III

Morning Phil,

I've attached my XLSX file.  The questions that I'm interested in are in rows 9 and 10.

Thanks Phil.

~Dan

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @DanBihari,

Taking a quick look at your xslx form, the expression in the choice filter is incorrect. As the result of a select multiple question is a comma seperated string, you can not use the status = ${Staff_Unit} expression, as the string in the choice sheet status column would have to match exactly the comma seperated string.

If you use selected() in the choice filter expression, it will work as expected as follows:

selected(${Staff_Unit},status)

I tested this with your xlsx file and works great.

Regards,

Phil.

View solution in original post

DanBihari
New Contributor III

Good Morning Phil,

I just implemented your solution and it worked perfectly!

Thank you very much for your assistance.

~Dan

BryanO_Reilly
New Contributor III

Hello Phil,

I seem to be having the same issue with my select multiple list not populating via the choice_filter expression. Would you be able to take a quick look and let me know what I'm missing? 

The select multiple question I'm trying to figure this out for is on row 10.

Thank you,

Bryan

 

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @BryanO_Reilly,

What version of Survey123 Connect/field app are you using? I just tested with 3.12 release and 3.13 beta and both working fine for me using your xlsx file you provided above.

For example when I select the BMP type as "Permeable Pavement" I can see the 3 choices in BMP Sub-Type that relate to that choice filter.

Philip-Wilson_0-1622428533410.png

Regards,

Phil.

0 Kudos
BryanO_Reilly
New Contributor III

Hello Phil,

Thanks for the reply. Yes the BMP Sub-Type question does seem to work fine, its the "select_multiple Perf_Test" question on row 10 that is giving me problems. 

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @BryanO_Reilly,

I am a little confused, the select multiple for Perf_Test also appears to work correctly for me. If I select one of the choices in the Type question, I see the related choices in the GI testing type question. When I select those I see the groups that are relevant based on those selections. Am I missing something? Can you explain in more details or provide screenshots or video recording?

Philip-Wilson_0-1622678408326.png

Regards,

Phil.

0 Kudos
BryanO_Reilly
New Contributor III

How very weird... the same setup for me doesn't seem to be working as it does for you. See attached screen recording. The xlsx form is version 3.12, so that shouldn't be the problem. Any other ideas why it may not be working for me?

0 Kudos
Philip-Wilson
Esri Frequent Contributor

Hi @BryanO_Reilly,

From the video it appears you are using an older version of Connect, at least 3.11 or earlier. I can tell by the UI design, it was updated in 3.12, the menu and locations of profile photo and settings menu are in a different location. Please update to 3.12 from the resources page: https://www.esri.com/en-us/arcgis/products/arcgis-survey123/resources#settingup

Select multiple cascading selects are not supported in 3.11 or earlier. You will need to refresh you survey and publish it again with 3.12, after that it should work as expected.

Phil.

View solution in original post

0 Kudos
BryanO_Reilly
New Contributor III

Beautiful, easy fix. Thank you very much for your assistance!

Best,

Bryan