Relevant rule for multiple choice selection in S123 Connect xls form

358
5
Jump to solution
a month ago
JacobPearse
New Contributor II

Hello,

I am creating a form using Survey123 Connect where I am trying to have the various invasive species questions visible based on a select multiple question that allows the user to select each invasive present at a given site. The goal is to have each group of questions appear based on any combination of the selected species (listed below). There is a group that is acting as a repeat for each species in the list.

So far, I am only able to get one to appear at time despite trying a variety of types of formulas. I apologize in advance since I have seen some similar inquiries to this and have yet to succeed in using some of the tips/suggestions.

Thank you!

Birdvetch

Canadathistle

Commontansy

Narrowleafhawkweed

Orangehawkweed

Oxeyedaisy

Fieldsowthistle

Quackgrass

Reedcanarygrass

Whitesweetclover

Meadowhawkweed

Yellowtoadflax

Waterweed

0 Kudos
3 Solutions

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @JacobPearse

For select_multiple you'll need to use the selected() function to evaluate if a choice was selected. Would you be able to explain what you mean by "various invasive species questions visible" will each invasive species have an associated question? 

 

If that's the case, in the relevant column for each invasive species question you'd use selected(${select_multiple_species}, 'birdvetch') for the Birdvetch invasive species question. 

Thank you,
Zach

View solution in original post

DuncanC
New Contributor III

Each group is only linked to one checkbox right?  You should just need to use the answer from above the way I read this. 

${invasivetypes} = 'Birdvetch'

That fails when your lists becomes 'Birdcetch, anytexthere', now the strings don't match.

selected(${select_multiple_species}, 'birdvetch') instead asks if that list (the data saved in the field for the select_multiple) contains your item, which is does so relevant is flagged and your group should show. 

If it's not working try the other variation of label or name, check the capitilization.  It'll be that. 

View solution in original post

DougBrowning
MVP Esteemed Contributor

Above is correct.  Cannot use = must use selected since it just a big string.  I would also consider using a repeat instead since having long strings of species in the data makes it really hard to use going forward.

View solution in original post

5 Replies
ZacharySutherby
Esri Regular Contributor

Hello @JacobPearse

For select_multiple you'll need to use the selected() function to evaluate if a choice was selected. Would you be able to explain what you mean by "various invasive species questions visible" will each invasive species have an associated question? 

 

If that's the case, in the relevant column for each invasive species question you'd use selected(${select_multiple_species}, 'birdvetch') for the Birdvetch invasive species question. 

Thank you,
Zach
JacobPearse
New Contributor II

Hello Zach,

Thank you for the input. I will try some combinations of the selected function. 

I have each species in a separate group and my intention is to use the relevant field to just show the group associated with the species selected in the multiple choice question.

For example, one of the ways I tried doing it and below did not appear to work to help provide context.

${invasivetypes} = 'Birdvetch' or ${invasivetypes} = 'Birdvetch, Canadathistle' or ${invasivetypes} = 'Birdvetch, Canadathistle, Commontansy' or ${invasivetypes} = 'Birdvetch, Canadathistle, Commontansy, Narrowleafhawkweed' - etc, etc. 

I included some screenshots to help illustrate.  I think I have been getting stuck on how to use it appropriately to include each combination of selection options and use the correct function.

Thank you again for the advice!

0 Kudos
DuncanC
New Contributor III

Each group is only linked to one checkbox right?  You should just need to use the answer from above the way I read this. 

${invasivetypes} = 'Birdvetch'

That fails when your lists becomes 'Birdcetch, anytexthere', now the strings don't match.

selected(${select_multiple_species}, 'birdvetch') instead asks if that list (the data saved in the field for the select_multiple) contains your item, which is does so relevant is flagged and your group should show. 

If it's not working try the other variation of label or name, check the capitilization.  It'll be that. 

DougBrowning
MVP Esteemed Contributor

Above is correct.  Cannot use = must use selected since it just a big string.  I would also consider using a repeat instead since having long strings of species in the data makes it really hard to use going forward.

JacobPearse
New Contributor II

Thank you everyone for your advice! I really appreciate it. Your are correct that the selected($invasivetypes},'species name') for each group works for getting each combination of the select multiple type (in my case the select multiple name is invasivetypes for that form question) and I did not need to try to use some long complicated string.

As I continue to work on this form, I will look into the suggestion of the repeat (Doug), as I currently have each group set up with a repeat within it based off the number of invasive patches at a site to have the end user create a geoshape since the inspection often finds different small areas of a particular invasive within the larger inspection site. Otherwise, the user would have to complete the survey for each individual invasive patch within the survey, submit it, and then go back and fill it out for each individual patch found which is not the biggest inconvenience, but they may appreciate being able to complete as much of their inspection with one submission.

Thank you all again!