I am trying to configure a survey that applies choice filtering for 3 questions. Here are the scenarios:
1. {tribal_gov} = Yes: show all 32 choices
2. {tribal_gov} = No, {state_esf} = No: show all 32 choices
3a. {tribal_gov} = No, {state_esf} = Yes, {esf_num} = 1 : show 1 choice
3b. {tribal_gov} = No, {state_esf} = Yes, {esf_num} = 2 : show 3 choice
3c. {tribal_gov} = No, {state_esf} = Yes, {esf_num} = 3 : show 2 choices
Some core capabilities can apply to multiple esf numbers
Scenarios 1 and 2 work. Scenarios 3a, b, and c do not. The drop-down option is not available in scenarios 3a, b, c
choice_filter statement: ${tribal_gov}='Yes' or ${state_esf}='No' or selected(esf_filter, ${esf_num})
Choices tab:
I am adding a space between each ESF. Perhaps that is not correct? esf_1 esf_2
Solved! Go to Solution.
Hi @GeoWorld13 ,
It looks like the issue is in the logic used for scenarios 3a/3b/3c.
When {state_esf} = Yes, your choice_filter probably needs to evaluate BOTH conditions together:
${esf_num}
and the values used in the choices sheet
If some capabilities belong to multiple ESF numbers, avoid using direct equality (=) against a concatenated field. Instead, use selected().
For example, if your choices sheet contains a column like:
esf_filter 1 2 3 2 5 1
then your choice filter should be something like:
(${tribal_gov}='Yes') or
(${state_esf}='No') or
(${state_esf}='Yes' and selected(esf_filter, ${esf_num}))The important part is:
selected(esf_filter, ${esf_num})instead of:
esf_filter = ${esf_num}because several core capabilities can belong to multiple ESF numbers.
Also make sure:
esf_filter values are space-separated (not comma-separated)
${esf_num} matches the choice name values exactly
the choice_filter column is on the question using the filtered list
2 things, in your sample the esf_filters are in the media::audio column, they should be moved over a column to the left. And then I think it is all the blank cells in the esf filter column. I filled them all with zeros and it worked.
Hi @GeoWorld13 ,
It looks like the issue is in the logic used for scenarios 3a/3b/3c.
When {state_esf} = Yes, your choice_filter probably needs to evaluate BOTH conditions together:
${esf_num}
and the values used in the choices sheet
If some capabilities belong to multiple ESF numbers, avoid using direct equality (=) against a concatenated field. Instead, use selected().
For example, if your choices sheet contains a column like:
esf_filter 1 2 3 2 5 1
then your choice filter should be something like:
(${tribal_gov}='Yes') or
(${state_esf}='No') or
(${state_esf}='Yes' and selected(esf_filter, ${esf_num}))The important part is:
selected(esf_filter, ${esf_num})instead of:
esf_filter = ${esf_num}because several core capabilities can belong to multiple ESF numbers.
Also make sure:
esf_filter values are space-separated (not comma-separated)
${esf_num} matches the choice name values exactly
the choice_filter column is on the question using the filtered list
@Georgios-NektariosTselos @Neal_t_k
Thanks for the suggestion. For some reason I still cannot get the choice filtering to to work. I have attached a sample .xlsx form if you want to check it out.
Now, none of the scenarios work...but I can't figure out why?
1. {tribal_gov} = Yes: show all 32 choices
2. {tribal_gov} = No, {state_esf} = No: show all 32 choices
3a. {tribal_gov} = No, {state_esf} = Yes, {esf_num} = 1 : show Critical Transportation choice
Using this ${tribal_gov}='Yes' or ${state_esf}='No' works. It is adding the last part that throws something off
2 things, in your sample the esf_filters are in the media::audio column, they should be moved over a column to the left. And then I think it is all the blank cells in the esf filter column. I filled them all with zeros and it worked.
@Neal_t_k Thank you!!!! Got it working now.
This may help with your multi-option part. You need the comma to separate the list items
Survey123 Tricks of the Trade: Choice Filters - Esri Community
After that, @Georgios-NektariosTselos appears to have the right logic above.