Logic/validation of numbers: How to set up validation of a Number question based on the answer in a previous Number question


Hi Team, 


I am looking to set up the maximum value in a number question as the value entered in a previous number question. Is this possible? Since we can force a value entry to match a value entered previously on the same page, I assume we should be able to set it as maximum rather than exact match…? 


Thanks in advance for your help.

Chris Lonergan answered

    If your account allows it, you can develop a custom script that would set the max number validation property of a question.

    The script would use the sgapiGetValue function to get the value entered into the first question, and then use the sgapiSetQuestionProperty function to set the max number value of the second question.

    Jim W (Moderator) edited answer

      Hey Guys, 


      For example, I have a question ‘Q1 [Open Numeric] How much would you pay?’.

      I want to script so ‘Q2 [Open Numeric] How much is too much?’ has to be more than ‘Q1’

      And ‘Q3 [Open Numeric] How much is too little?’ to be less than Q1.


      The value match is a toggle option already available in the validation tab, but a script implemented would work. Is this something that already exists or needs a custom script?


      Chris Lonergan answered


        Question stats

        • Active
        • Views5602 times
        • Answers2 answers
        • Followers2 followers