[Solved] Use Hidden Value or Action to Create Variable Based on Response?



Our surveys are for higher education institutions. Each higher education institution belongs to a certain classification (e.g. doctoral, masters, baccalaureate, etc.). Rather than having respondents input this information (which they may not know), we would like them to simply select their institution. The next step is where my question comes in. Is there any way to automatically look up their classification and save that in a hidden variable? Can this be done through some sort of action or easily implementable Lua/R code?


Thanks in advance,


Anthony Schmidt answered

    Best answer


    I do not know how you are distributing the links to the survey or how many institutions are involved, but my first inclination would be to use tracking links (https://help.surveygizmo.com/help/tracking-links).  If this function is not available in your account then the next option would be to use URL variables (https://help.surveygizmo.com/help/using-url-variables-in-surveys).

    If you need to use a LUA script, I would start by creating a hidden admin-only page that follows the Institution? question.  I would place the classification question on this page and the place the LUA script below it.

    The LUA script would just be a series of IF statements.  In pseudocode it would look something like this:

    IF getvalue(Institution)==”Penn State”
          setvalue(classification, “masters”)
    IF getvalue(Institution)==”Johns Hopkins”
          setvalue(classification, “doctorate”)

    It’s not elegant coding, but anyone esle who works on the survey with you will be able to understand what the code is doing.

    Good luck!


    Jim W (Moderator) edited answer


      Question stats

      • Active
      • Views746 times
      • Answers1 answer
      • Followers1 follower