Logo Help Center
Chat with us
Open a ticket
Sign in
  1. aytm Help Center
  2. aytm Logic
  3. Variable Types

Articles in this section

  • Referencing Race/Ethnicity through Logic
  • Direct References
  • Aliases
  • Variables
  • Arrays
  • Supported List of Mathematical Operations

Variables

Sometimes referring to an answer chosen earlier in the survey is not enough. You may want to cluster respondents by many conditions, based on the way they answered different questions, their known demographics, etc. You can declare and alter variables throughout the survey and then adjust survey logic accordingly.

 

Quiz Score 

If your survey is a quiz, you can increase or decrease the running score for each respondent as they fail or succeed answering your questions. The value of your variable will be kept individual for each respondent and you can refer to it when you are ready to show the results or alter survey experience based on their achievements.

Please note: Instead of "QuizScore" you can use any alphanumeric variable name that suits your needs (A-Z, a-z, 0-9,_). Underscores are allowed.

  • [QuizScore = 0] - Initializes variable "QuizScore" with the value 0.
  • [QuizScore + 1] - Adds 1 to the value of variable "QuizScore"
  • [QuizScore - 5] - Subtracts 5 from the value of variable "QuizScore"

Show respondents the value of any variable by surrounding its name in square brackets. For example:

  • [QuizScore] - Will show respondent the score they've achieved by the time they enter the field.
    • Helpful Hint: You may also want to use this method to see the value of a variable during survey programming process to check that everything works as expected and then remove it before launching if you don’t want respondents to see it.

 


 

NPS 

Create a variable "NPS" and assign respondents value "Promoter" or "Detractor" based on the answers they gave on your NPS (Net Promoter score) question. Later on you can append an extra modifier to the variable, if you find them to be an influencer on top of being a Promoter.

  • [NPS = "Promoter"] - Initializes variable "NPS" with the text value "Promoter"
  • [NPS + "and Influencer"] - Adds "Influencer" string to the "NPS" variable: resulting in "Promoter and Influencer"

As you can see from the examples above, variables can store text or numbers for further use in the logic.

 


 

Creating Custom Variables

aytm Logic doesn't require you to declare variables before using them where needed. The type of variable (text or numbers) is determined on when you used it for the first time. By default each variable stores an empty value "".

Guidelines to creating name of the variable:

  • The following characters may be used in variable names: A-Z, a-z, 0-9 and the underscore symbol "_".
  • Variable names must always begin with a letter.
  • String values of variables must be surrounded by quotes and may contain any character.
  • Variable names cannot be identical to a few reserved names:
    • aytm_response_id, uuid, var1, var2, var3, device, browser, vr_collected, gender, income, education_level, age, children, relationship_status, ethnicity, employment, career, show, hide, group, if, not, max, or, and, exclude, exit, region, country, state, county, and zip. 
  • No variables can start with letter Q# (followed by a number) or letters PQ# (followed by a number), as they are reserved for direct references.

 


 

Reserved Variables

  • Use one of the reserved variable names in square brackets to pipe in the respondents' values: uuid, var1, var2, var3, device, browser, gender, income, education_level, age, children, relationship_status, ethnicity, employment, career, region, country, state, county, and zip.
    • For example, as pictured below, type in the following Question: "We've noticed that you're using [device] to take this survey. Is this correct?". Respondent, answering on an iPhone will see: "We've noticed that you're using mobile to take this survey. Is this correct?"
  • Var1, var2, and var3 can be mapped to give you access to any custom variables you are passing through the URL when using list surveys.
  • Variables will be initialized and updated when respondent exits the question, so you can't rely on a manipulation with the variable within a question until they've made their choice and moved to the next one.
2024-03-12_14-59-58.png

 

  • Facebook
  • Twitter
  • LinkedIn
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Return to top
  • Our platform
  • Solutions
  • Pricing
  • Our panels
  • Help center
  • Contact us
  • Blog
  • Privacy
  • TOU
  • About
  • Careers
  • Innovation lab
  • Demo
© 2022, Umongous, Inc. All rights reserved.

zendesk theme design by aytm c/o diziana