Require response for a constant sum question | XM Community
Solved

Require response for a constant sum question

  • 29 March 2018
  • 3 replies
  • 92 views

Badge +3
I've written a question that asks the respondent to enter the amount of funding coming from different revenue sources. I used constant sum, with the total box at the end. I don't want them to be able to skip the question. The forced response option is not offered for constant sum questions. I tried the enforce range option, but that won't work because not every line in the constant sum will necessarily have a value entered (every respondent will not use every one of the revenue sources). Any ideas how I might be able to get this to work the way I envisioned?
Thank you!
icon

Best answer by bstrahin 3 April 2018, 20:40

View original

3 replies

Userlevel 7
Badge +27
Using JavaScript you can disable and/or hide the Next button unless the total is greater than 0.
Badge +3
That would work! You don't happen to have the code for that, do you?
Thanks!
Userlevel 7
Badge +38
@MaryHoban there's another option if you are not comfortable with writing Javascript. In the right hand menu below enforcing a range there is an option for Validation Type. Choose custom. Add logic:

Question Funding Source 1 - Value Is Greater Than 0
OR Question Funding Source 2 - Value Is Greater Than 0
OR Question Funding Source 3 - Value Is Greater Than 0

.
.
.

OR Question Funding Source n - Value Is Greater Than 0

This is making sure at least one of your values is not zero. It has the same effect as checking that the total is greater than zero but you don't have to know Javascript. If you have a lot of funding sources it can be tedious, but maybe a better option depending on your comfort with writing custom code.

Leave a Reply