Select to view content in your preferred language

Using choice_filter with select_multiple

1213
5
Jump to solution
04-16-2024 11:01 AM
dwold
by
Frequent Contributor

I have 2 select multiple questions, the second having a choice_filter set on it. However, when multiple choices are selected in the first question, the responses disappear in the 2nd question. choice_filter reads: regex(area, ${mission_area}). I was following this blog for guidance.

Form (survey & choices):

dwold_0-1713290295953.png

dwold_0-1713290649176.png

Survey one selected:

dwold_2-1713290381239.png

Survey two selected:

dwold_3-1713290424648.png

 

 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

In the area column I do not think you can list all the options with a comma since it does an exact match search.  You need to break this out and list them multiple times, one for each area type.  At least I have never seen a comma lookup list work.

View solution in original post

5 Replies
abureaux
MVP Frequent Contributor

I believe your question is backwards. Try: regex(${mission_area}, area)

EDIT: Also, you don't need to use regex for this. You can also use selected(). E.g., selected(${mission_area}, area). Not a big deal since they are virtually identical in this scenario, but it's worth noting.

dwold
by
Frequent Contributor

@abureaux thanks for the tip! That allows me to selected multiple mission areas but not all the core capabilities get populated with each additional selection. See anything else I am missing? If I select Recovery, I'd want Infrastructure Systems to appear but it currently does not. This is the case with all the Core Capabilities with multiple areas listed.

dwold_0-1713297156375.png

dwold_1-1713297187745.png

Infrastructure Systems doesn't appear if either Response or Recovery is selected. Neither do the top three core capabilities in the choices table

dwold_2-1713297256536.pngdwold_3-1713297310780.png

Anything in my choices table that looks wrong?

dwold_4-1713297349990.png

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

In the area column I do not think you can list all the options with a comma since it does an exact match search.  You need to break this out and list them multiple times, one for each area type.  At least I have never seen a comma lookup list work.

RafaeldePedro
Frequent Contributor

@DougBrowning @dwold sorry a bit late to this one but I'd like to weigh in here. I know the response has been marked as the solution but that hasn't worked out for me.

In my experience, having the values from the 'area' field listed and separated by commas is okay, and it works well in my experience, but this is only if the 'Select Mission Area' field was a select one type instead of a select multiple.

I am now in similar case to the OP's, trying to use a Regex function to filter values based on the selected values from a previous, select multiple type question. In my case, the 'area' field would not have multiple values separated by commas, as @DougBrowning would suggest, but this wouldn't work. Like the OP, if I choose one value from the select multiple, then the choice filter works okay (with the regex function) but if I choose another one then it all goes blank and I can't revert by unselecting, etc.

In my head, I'm trying to use a combination of the regex and selected functions together, but so far it doesn't seem possible, or I haven't cracked it yet.

Can @dwold confirm that this worked for you and maybe share another screencap of the choice filter function?

Thank you

RafaeldePedro_0-1748507328086.png

 

RafaeldePedro_1-1748507394302.png

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

I think the regex issue would be the order the items are picked.  Select multiple stores in the order the user clicked not the order of the list.  That could mean infinitive combinations of the values list.  I see there is a contains now for choice filter but not sure how that would work.  I do not think a filter can have an or?  So selected combined with contains?

0 Kudos