How to trigger an error message if the value of a slider item is higher than the value of the previous slider | XM Community
Skip to main content

Hi everyone

I have two successive visual slider questions which ask first about total break time and then the amount of total break time spent in a certain area.

I’m trying to code survey logic which displays and error message/retry prompt if a participant attempts to set the second slider’s value greater than the first one.

Thank you!

Use Custom Validation on the second slider. The slider value must be less than or equal to the piped value of the first slider.


Thanks ​@TomG.  I used this logic (see pic). During preview the error message I created displays and wont let me progress, even if a value is selected less than the first slider.  I note that when I programmed the custom validation, no options populated in the drop down box for conditions. Do I need to create an embedded field or hidden captured text for the custom logic to work?


I’m assuming you labeled your slider “1”.  The condition should look something like:

Q10.27.2 … 1 Is Less Than or Equal to ${q://QIDxx/ChoiceNumericEntryValue/1}

Where QIDxx is the QID of the first slider


Thanks ​@TomG.  I’m not sure what’s going on, however using this logic continues to trigger my  error message and won’t let me proceed with the next question even if the value is lower. I wonder if the issue was that I had altered the QID’s or was using numbers with decimal points. But when I duplicated the questions and used the Qualtrics-assigned question numbers in the same logic, the problem persisted. Inverting the operation and setting the condition that Slider 1 is > or equal to Slider 2 didn’t resolve the issue. 

 


It could be that the pipe for the first slider doesn’t end in /1. Pipe the slider 1 value into your Question text, then copy the piped string into your validation condition.


Hooray ​@TomG 

 

The issue was a hidden QID, revealed by piping text.

 

Thank you!

 

Mark