How to add validation to a whole block | XM Community
Skip to main content

How to add validation to a whole block

  • February 5, 2023
  • 4 replies
  • 313 views

Forum|alt.badge.img+3

I have a list of options for respondents to choose from. The list is broken down into 3 separate questions for easier reporting, but is meant to look like a list with 3 sections to respondents. We would like to add validation so that no more than 3 options from the whole list, not just one of the sections, may be selected. Is there a way to add validation to the whole block?
Screen Shot 2023-02-05 at 12.58.20 PM.png

4 replies

grahulp5
QPN Level 3 ●●●
Forum|alt.badge.img+13
  • QPN Level 3 ●●●
  • 238 replies
  • February 6, 2023

You can add them into just 1 question and use group to group them and give them a label. Then use validation to allow no more than 3 choices.


MatthewM
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 1084 replies
  • February 6, 2023

Hi ChelseaIC ,
You should be able to use Custom Validation with the "Selected Count" option, in separate Logic Sets for each possible combination, to achieve this. It would look something like:
If Q1 Selected Count is Equal to 3 and Q2 Selected Count is Equal to 0 and Q3 Selected Count is Equal to 0.
OR
If Q1 Selected Count is Equal to 2 and Q2 Selected Count is Equal to 1 and Q3 Selected Count is Equal to 0.
OR
If Q1 Selected Count is Equal to 2 and Q2 Selected Count is Equal to 0 and Q3 Selected Count is Equal to 1.
And so on...


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • February 6, 2023

https://community.qualtrics.com/XMcommunity/discussion/comment/55117#Comment_55117An easier way to do this is with one custom validation rule on the first question. Something like (use the actual QIDs of your 2nd and 3rd questions):
Q1 SelectedCount Is Less Than or Equal to $e{ 3 - q://QID2/SelectedChoicesCount - q://QID3/SelectedChoicesCount }


Forum|alt.badge.img+3
  • Author
  • Level 1 ●
  • 5 replies
  • February 20, 2023

grahulp5 I was unaware that grouping multiple choice options was something that I could do - I wish I had realized that before I started getting responses. When I roll out this same survey next year, I will definitely do that. Thank you!
I was able to get the validation to work with TomG's suggestion. Thanks TomG and MatthewM for your help on this!