Select to view content in your preferred language

Survey123 Dynamic Choices based on an Integer Field

251
2
3 weeks ago
JeetzPatel
Occasional Contributor

Hi all. I am expanding on a Survey123 form I've generated for our asset inspections team. They have assets that have multiple Groups of Components, where each Component needs to be inspected. To avoid users having to populate multiple repeats where there is more than one Group that is identical based on the Component material, quantity etc., I have an integer field (${numberGroups}) that asks users to enter the # of Groups, and a select_multiple field (${selectIdenticalGroups}) that asks users to select each Group that is identical.

For example, if an asset has 8 Groups of Components, and 4 Groups have identical components (e.g. Group #1, Group #2, Group #7 and Group #8), the user would tick these groups in ${selectIdenticalGroups}.

JeetzPatel_0-1754886684824.png

 

The issue I have is that for all assets, the maximum number of Groups is unknown (hence the need for Survey123). I want the maximum number of options for the select_multiple ${selectIdenticalGroups} to be equal to the ${numberGroups} field e.g:

JeetzPatel_1-1754886795452.png

Does anyone know how I can set perhaps a choice_filter on the choices tab to dynamically limit each of the choices for ${selectIdenticalGroups} based on ${numberGroups}? Thank you for your time!

Tags (1)
0 Kudos
2 Replies
MErikReedAugusta
MVP Regular Contributor

Instead of checkboxes from a list, why not set a repeat of questions with a free-entry integer field?  In your example, 1, 2, 7, and 8 would be entered as single answers within the repeat, rather than a single checkbox question.

If you're trying to nest that in a repeat (of multiple groups), then things are likely to be a bit messier.

------------------------------
M Reed
"The pessimist may be right oftener than the optimist, but the optimist has more fun, and neither can stop the march of events anyhow." — Lazarus Long, in Time Enough for Love, by Robert A. Heinlein
0 Kudos
JeetzPatel
Occasional Contributor

Thanks for this, I do have nested repeats which would make things difficult. I will keep investigating.

0 Kudos