How can we restrict total sum and disable the "go to Next" feature till the validation is correct | XM Community
Skip to main content
In my survey, user has to fill in hours for different initiatives (as a constant sum) and the total hours should be less that the total available hours. The total available hours is an text with calculation via Piped text. I need to somehow restrict people to not over allocate hours and disable the next page if the same happens
Hey @Kohsheen! It looks like you reached out to our Support team regarding this inquiry! We would love it if you shared with the rest of the Community the answer you received in regards to using Custom Validation in conjunction with Math Operations!
It looks like our specialist provided the following custom validation solution:



If | Question | First answer choice | is | Less than or Equal to | $e{ [NUMBER YOU WANT AS MAX] - q://QID1/ChoiceNumericEntryValue/2 - q://QID1/ChoiceNumericEntryValue/3 - q://QID1/ChoiceNumericEntryValue/4 }

And | Question | First answer choice | is | Greater than or Equal to | $e{ [NUMBER YOU WANT AS MIN] - q://QID1/ChoiceNumericEntryValue/2 - q://QID1/ChoiceNumericEntryValue/3 - q://QID1/ChoiceNumericEntryValue/4 }



You will need to change out the QID's and add/subtract more or less ChoiceEntryValue piped texts, but otherwise it works great. Be sure to check recode values to make sure your piped text is grabbing the right values. As always, if others have questions about this setup, please feel free to contact our Support team!

Leave a Reply