AYTM Logic


AYTM logic is a simple yet powerful way to program most surveys on the platform, covering everything from simple skip logic and piping to very advanced researcher needs, including custom variables, references, monadic survey design, groups, and more! With a series of simple language statements, written in [square brackets] right in the survey fields, you can build a tailored survey taking experience for respondents, while keeping full control of how the data is collected and compiled for analysis.


Here are a few examples of what you can do with AYTM Logic:


  • Show or hide a question/answer if respondent has selected a specific answer on another question
  • Pipe-in top answer text from a ranking (reorder) question
  • Skip respondent to the end of the survey if specific conditions are met
  • Modify question text based on a cluster respondent becomes assigned to as a result of a typing tool section of the survey or other conditions
  • Set up sequential monadic studies: show each respondent 3 batteries of questions out of 15 total batteries in the group
  • Program a quiz, keep track of the progress and display customized results screens at the end.


Variable types


Direct references


Direct references point to a specific survey question, or to one of its subparts. You can think about it as an address of any given field within the survey. Use the following conventional letters to refer to a question, sub-question or one of its answers. A few example of direct references:


  • PQ1 - refers to the first Pre-Qualification question
  • PQ1A1 - refers to the first Answer on the first pre-qualification question
  • Q1 - refers to the first Question
  • Q1A1 - refers to the first answer on the first question
  • Q1SQ1 - refers to the first Sub-Question of the first (matrix) Question
  • Q1SQ1A1 - refers to the first Answer on the first Sub-Question of the first Question

EXAMPLES:


  • [Hide if PQ1A1] - If you insert this logic into a question field, entire question will be hidden for those respondents who have selected the first answer on the first pre-qualification question of the survey.
  • [Q1A1] - Say first answer on the first question was "Toyota". By inserting this reference into any following field in the survey you can remind respondents of their choice and ask for clarifications. For example: if you program: "You have mentioned earlier that your favorite car brand is [Q1A1]. Please share why." respondent will see: "You have mentioned earlier that your favorite car brand is Toyota. Please share why."

References are programmed to refer to the same element, even if its location has changed due to addition of new elements in front of it, or even due to dragging it to a different place. Thus, [Show if Q1A1] will become [Show if Q2A1] if you add a new question in front of Q1. Same applies for other levels of the hierarchy: sub-questions and answers.


If you delete an element, referenced in an AYTM logic, the reference will be highlighted in orange. We will also add a "?" sign in front of it (e.g. [Show if ?Q1A1]), indicating that it now points to a different question than initially targeted, and it needs your attention. Don't worry - it is not possible to launch a survey without fixing all broken references.




All question types

Question level

[Q1] or [PQ1]

  Single-choice prequal

Answer level

[PQ1A1]

  Multiple positive choices prequal

Answer level

[PQ1A1]

  Multiple negative choices prequal

Answer level

[PQ1A1]

  Radio buttons

Answer level

[Q1A1]

  Checkboxes

Answer level

[Q1A1]

  Sliders

Sub-question level

[Q1SQ1]

  Sliders

Sub-question - answer level

[Q1SQ1A1]

  Progressive matrix

Sub-question level

[Q1SQ1]

  Progressive matrix

Sub-question - answer level

[Q1SQ1A1]

  Smiley rating

Sub-question level

[Q1SQ1]

  Smiley rating

Sub-question-Smiley level

[Q1SQ1A1]*

  Star rating

Sub-question level

[Q1SQ1]

  Star rating

Sub-question-Star level

[Q1SQ1A1]*

  Reorder (ranking)

Item level

[Q1A1]

  Side-by-side comparison

Answer level

[Q1A1]

  Distribute

Item level

[Q1SQ1]

  Polarity Scale

Scale level

[Q1SQ1]

  Polarity Scale

Scale-left

[Q1SQ1A1]

  Polarity Scale

Scale-right

[Q1SQ1A2]

  Video response

Talking point

[Q1A1]*

  Combobox

Item level

[Q1A1]

  Forms

Field level

[Q1A1]

  Quadrant Analysis

Entity level

[Q1E1]

  Quadrant Analysis

Entity-Attribute level

[Q1E1SQ1]

  Quadrant Analysis

Entity-Attribute-Star/Slider value

[Q1E1SQ1A1]*

  Competitive Topography

Entity level

[Q1E1]

  Competitive Topography

Entity-Attribute level

[Q1E1SQ1]

  Competitive Topography

Entity-Attribute-Star/Slider value

[Q1E1SQ1A1]*

*- in development



Aliases


Complex surveys often evolve over the time, questions get added or removed as the study takes shape. When it happens, one of the ways to avoid eventual correction of direct references is to assign special aliases to the key fields of your survey. They work just like the direct references but will remain constant regardless of the position of the field. They always start with the "@" sign immediately followed by an alphanumeric alias name you come up with to help you remember and identify the reference. @aliases are referencing an exact field within question where they are entered or the question itself. Aliases must be unique within a survey.


EXAMPLES:


  • [@likesPurple] was placed in a question Q18, asking of the color preferences, at the purple answer (A5) . This is later used in a different question [Show if @likesPurple] to only address the subset of respondents who selected that answer. Now you can move Q18 and A5 within it to any position and the reference will still work.



All question types

Question level

[Q1] or [PQ1]

  Single-choice prequal

Answer level

[PQ1A1]

  Multiple positive choices prequal

Answer level

[PQ1A1]

  Multiple negative choices prequal

Answer level

[PQ1A1]

  Radio buttons

Answer level

[Q1A1]

  Checkboxes

Answer level

[Q1A1]

  Instruction text

Instruction text

[Q1A1]

  Sliders

Sub-question level

[Q1SQ1]

  Progressive matrix

Sub-question level

[Q1SQ1]

  Smiley rating

Sub-question level

[Q1SQ1]*

  Star rating

Sub-question level

[Q1SQ1]*

  Reorder (ranking)

Item level

[Q1A1]

  Side-by-side comparison

Answer level

[Q1A1]

  Distribute

Item level

[Q1SQ1]

  Polarity Scale

Scale-left

[Q1SQ1A1]

  Polarity Scale

Scale-right

[Q1SQ1A2]

  Video response

Talking point

[Q1A1]*

  Forms

Field level

[Q1A1]*

  Quadrant Analysis

Entity level

[Q1E1]*

  Competitive Topography

Entity level

[Q1E1]*

*- in development



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.


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.


  • [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"

Another example: you can 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. To simplify things AYTM Logic doesn't require you to declare variables so you can start using them where you want. The type of variable (text or numbers) is determined on initialization when you used it for the first time. By default each variable stores an empty value "". You can use the following characters in the name of the variable: 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 can't be identical to a few reserved names: uuid, var1, var2, var3, device, browser, gender, household_income, education, age, parental_status, relationship_status, ethnicity, employment_status, career, show, hide, group, if, not, max, or, and, exclude, and exit. Also 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.


You can show respondent the value of any variable by surrounding its name in square brackets. For example,


  • [QuizScore] - From the example above, will show respondent the score they've achieved by the time they enter the field.

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.


Furthermore, you can use one of the reserved variable names in square brackets to pipe in their value: uuid, var1, var2, var3, device, browser, gender, household_income, education, age, parental_status, relationship_status, ethnicity, employment_status, and career. For example, you can 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.



Reference Usage


References and aliases can be used in multiple ways, achieving a wide range of possible text and survey flow manipulations. Below you will see different ways references and aliases can be used to point to a specific text or an image, check if respondent was exposed to a question, and many other uses.



Exposure


When references or aliases pointing to a question or a sub-question are used in survey flow operators without any additional modifiers, they are treated as a True/False, based on whether the respondent was exposed to (saw) the question or not. Exposure logic is only limited to references and aliases pointing to question or sub-question levels.


EXAMPLES:


  • [show if @selectedForDetailedInspection] - The alias @selectedForDetailedInspection was placed in a question, which only a portion of respondents saw. The logic was placed in a different question, restricting the exposure to only this particular subset of respondents.
  • [show if Q5] - Same as above, but with a direct reference to the question, Q5 in this case
  • [show if Q5SQ1] - Same as above, but referencing exposure to the first sub-question of Q5
  • [skip to Q10 if Q5] - Skips respondent to the Q10, if respondent was exposed to Q5.
  • [skip to Q10 if not Q5] - Skips respondent to the Q10, if respondent was NOT exposed to Q5


Choice


When references or aliases pointing to an answer are used in survey flow operators without any additional modifiers, they are treated as a True/False, based on whether the respondent has selected this answer or not. Selection logic is only limited to references and aliases pointing to an answer.


EXAMPLES:


  • [show if @selectedForDetailedInspection] - The alias @selectedForDetailedInspection was placed on an answer level. The logic was placed in a different question, restricting the exposure to only those who selected the answer where the alias resides.
  • [show if Q5A1] - Same as above, but with a direct reference to the first answer in the fifth question
  • [show if Q5SQ1A1] - Same as above, but with a direct reference to the first answer of the first sub-question in the fifth question
  • [skip to Q10 if Q5A1] - Skips respondent to the Q10, if respondent selected A1 on the Q5.
  • [skip to Q10 if not Q5A1] - Skips respondent to the Q10, if respondent did not select A1 on the Q5


Piping Text


It is possible to extract question/sub-question/answer texts using direct references. This can be done by simply mentioning the reference in the logic, without any modifiers. The logic can be placed at any level: question, sub-question, answer. Please note, that respondent has to have been exposed to the element first before the text can be used in the logic. If the exposure didn't happen, "logic error" would be piped instead. Please note, if you want to pipe answer text in questions which have the sub-question level, you must mention a sub-question in the reference. For example, [Q1SQ1A5] would be the right way of piping fifth answer text from the first question.


EXAMPLES:


  • [Q10] - Wherever this logic is placed, question text from Q10 would be piped in.
  • [Q10 if Q5A1] - This will pipe text from Q10 if respondent chose the first answer from the fifth question
  • [Q10 if @promoter] - This will pipe text from Q10 if respondent was aliased as promoter somewhere previously in the survey.
  • [Q10A1] - Wherever this logic is placed, first answer text from Q10 would be placed instead of the logic.
  • [Q10A1 if Q5A1] - This will pipe text from the first answer of Q10 if respondent chose the first answer from the fifth question
  • [Q10A1 if @promoter] - This will pipe text from the first answer Q10 if respondent was aliased as promoter somewhere previously in the survey.
  • [Q10SQ1] - Wherever this logic is placed, first sub-question text from Q10 would be placed in place of the logic.
  • [Q10SQ1A1] - Wherever this logic is placed, first answer from the first sub-question text from Q10 would be placed instead of the logic.


Response Text


It is possible to get answer text(s) for only selected answers by appending the "R" modifier to the reference. Additionally, to obtain n'th selected text, you can also append a number to get selection at this position. Please note, that the system records responses in order they were given by respondent, so randomization of items will influence the order of responses.
If there is more than one element returned, the system will connect them with commas, and a ", and " at the last element. This rule changes to an alternative rule relevant to the chosen survey locale.


EXAMPLES:


  • [Q10R] - Q10 is a single-choice question. This reference, wherever placed, would then pipe text from the answer that respondent chose in Q1. A common use-case would be to construct a question text similar to the following: You have selected [Q10R] as your favorite animal. Please share why.
  • [Q10R1] - Q10 is a multi-choice question. This reference, wherever placed, would then pipe text from the first answer that respondent chose in Q10.
  • [Q10R] - Q10 is a multi-choice question. This reference, wherever placed, would then pipe text from all chosen answers in Q10. The items would be connected with delimiters and conjunctions. A common use-case would be to construct a question text similar to the following: You have selected [Q10R] as your favorite animals. Please share why. The respondent would see something like: “You have selected cows, horses, and goats as your favorite animals”
  • [Q10R1 if Q10RN>0] - Q10 is a multi-choice question. This reference, wherever placed, would then pipe text from the first answer that respondent chose in Q10 if they have made at least one choice.
  • [Show if Q1R='six month ago'] - The element of the command will only be shown if the response on Q1 was "six month ago"


  Single-choice prequal

Response text

[PQ1R]

  Multiple positive choices prequal

All response texts delimited

[PQ1R]

  Multiple positive choices prequal

One response text delimited

[PQ1R1]

  Multiple negative choices prequal

All response texts delimited

[PQ1R]

  Multiple negative choices prequal

One response text delimited

[PQ1R1]

  Radio buttons

Response text

[Q1R]

  Checkboxes

All response texts delimited

[Q1R]

  Checkboxes

One response text delimited

[Q1R1]

  Open ended

Open ended response text

[Q1R]

  Sliders

All response texts (answer texts) delimited

[Q1R]

  Sliders

One response text

[Q1R1]

  Progressive matrix

All response texts (answer texts) delimited

[Q1R]

  Progressive matrix

One response text

[Q1R1]

  Smiley rating

All response texts (Smiley texts) delimited

[Q1R]

  Smiley rating

One response smiley text (e.g. "Angry")

[Q1R1]

  Star rating

All response texts (Star texts) delimited

[Q1R]

  Star rating

One response star text (e.g. "1 star" "5 stars")

[Q1R1]

  Reorder (ranking)

All top ordered items, delimited

[Q1R]

  Reorder (ranking)

One top ordered item text

[Q1R1]

  Side-by-side comparison

All top ordered items texts delimited

[Q1R]

  Side-by-side comparison

One top ordered item

[Q1R1]

  Distribute

/th>

All tick text responses, delimited

[Q1R]

  Distribute

One tick text response

[Q1R1]

  Polarity Scale

All tick values reported, delimited (no sign)

[Q1R]

  Polarity Scale

One reported tick value (no sign)

[Q1R1]

  Combobox

Response text

[Q1R]

  Cascade

Response texts, delimited

[Q1R]*

  Cascade

Response text from one field

[Q1R1]*

  Forms

Reported field texts, delimited

[Q1R]*

  Forms

One reported field text

[Q1R1]*

  Quadrant Analysis

All response texts (Star/slider texts) delimited

[Q1R]

  Quadrant Analysis

One response texts (Star/Slider texts)

[Q1R1]

  Competitive Topography

All response texts (Star/slider texts) delimited

[Q1R]

  Competitive Topography

One response texts (Star/Slider texts)

[Q1R1]

*- in development



Number of Responses


Use "RN" addition to the reference to obtain the number of selected items. This is relevant for multi-choice question types, as one may create survey flow based on how many checkboxes were ticked by respondents.
For the optional open-ended question, the "RN" returns 0 if respondent opted to proceed without writing anything.


EXAMPLES:


  • [Q10RN] - This logic will display the number of selected answers in Q10, as a plain number
  • [Q10SQ1RN] - This logic will display the number of selected answers in the first sub-question of Q10, in a plain number
  • [show if Q10RN>1] - The item where this logic resides will only be shown if the number of selected answers in Q10 is greater than 1.
  • [show if Q4 and Q4RN=1] - Q4 is an open-ended question type, with the "optional" feature enabled. This code will make the element visible if respondent was exposed to the fourth question, and wrote something in it.


Comment Text


By appending "C" to the end of the reference you can extract and display the open-ended response from an appropriate element.


EXAMPLES:


  • [Q10C] - Q10 is an open-ended question. This command will extract the comment from the question and pipe it in place of the logic.
  • [Q10A1C] - Q10 is a single-choice question, and the first element has an open-ended field enabled. This command would extract the answer, and pipe it in place.
  • [Q10RC] - This command will extract all open-ended responses from Q10 and display them with delimiters and conjunctions.
  • [Show if Q1RC='six month ago'] - The element of the command will only be shown if the response on an open-ended question Q1 was "six month ago"


Image


To show an image associated with the element, append "i" to the direct reference and the image will become attached to the field. If no image was present, no image will be shown, and no error will be thrown. Please note - an error will be shown if there is no possible way respondent could have seen an image, no matter what they would have chosen. The check is in place to help you remember to attach images.


Please note: If it’s important that the piped in image appears expanded to the respondents (fills the entire width of the survey widget), please upload an image placeholder to the field and apply expand, scroll settings to it as desired. Piped in images will inherit the same settings. If you have a placeholder image, (which can be anything), please keep in mind that it may be shown to respondents if piped image was unavailable.









EXAMPLES:


  • [Q1i] - Wherever placed, this command will place an image taken from the first question.
  • [Q1A1i] - Wherever placed, this command will place an image taken from the first answer on the first question.
  • [Q1R1i] - Wherever placed, this command will place an image taken from the first response on the first question.
  • [show if q1R1i] - The element will be shown if the first response from the first question had an image


Ranges


There are multiple ways you can omit writing multiple "and"/"or" operators. This can be done on one level (answers), or on multiple (both answers and subquestions, answers and questions, etc.).



Comma = AND


Comma can be used instead of writing repeating "X and X and X" sequence. The shortcut allows a faster alternative to repeating the same question and sub-question numbers.


EXAMPLES:


  • [show if Q1A1,3,5] - This is shorter and more convenient way of writing [show if Q1A1 and Q1A3 and Q1A5]. The element would be shown only if the answers A1, A3, and A5 were selected on the first question.
  • [skip to Q5 if Q1A1,5 and Q2A1] - While the comma allows writing neat combination, if there's a need to add a different level, "and" would still have to be used. In this case the respondent skips to Q5 if they selected A1 and A5 from Q1, and the first answer from the second question.


Colon = AND


Colon symbol can be used instead of writing repeating "X and X and X" sequence of consecutive elements. The shortcut allows a faster alternative to repeating the same question and sub-question numbers, as well as it allows increased readability, as it only requires two numbers to reference the whole range


EXAMPLES:


  • [show if Q1A1:3] - This is shorter and more convenient way of writing [show if Q1A1 and Q1A2 and Q1A3]. The element would be shown only if the first three items were selected on the first question.
  • [skip to Q5 if Q1A1:3 and Q2A1] - While the colon allows writing neat combination, if there's need to add a different level, "and" would still have to be used. In this case the respondent skips to Q5 if they selected A1 through A3 from Q1, and the first answer from the second question.


Dot = OR


Dot symbol can be used instead of writing repeating "X or X or X" sequence of elements. The shortcut allows faster alternative to repeating the same question and sub-question numbers.


EXAMPLES:


  • [show if Q1A1.3.5] - This is shorter and more convenient way of writing [show if Q1A1 or Q1A3 or Q1A5]. The element would be shown only if any of the answers A1, A3, and A5 were selected on the first question.
  • [skip to Q5 if Q1A1.3 or Q2A1] - While the dot allows writing neat combination, if there's need to add a different level, "or" would still have to be used. In this case the respondent skips to Q5 if they selected A1 or A3 from Q1, or the first answer from the second question.


Dash = OR


Dash symbol can be used instead of writing repeating "X or X or X" sequence of consecutive elements. The shortcut allows omitting of repeating the same question and sub-question numbers, as well as it allows increased readability, as it only requires two indices to denote the whole range


EXAMPLES:


  • [show if Q1A1-3] - This is shorter and more convenient way of writing [show if Q1A1 or Q1A2 or Q1A3]. The element would be shown only if any of the first three items were selected on the first question.
  • [skip to Q5 if Q1A1-3 or Q2A1] - While the dash allows writing neat combination, if there's need to add a different level, "or" would still have to be used. In this case the respondent skips to Q5 if they selected any of A1 through A3 from Q1, or the first answer from the second question.


Multi-level


It is also possible to shorten the logic for cases, when the same answers need to be checked on multiple questions or subquestions. The ranges can be applied on multiple levels of the hierarchy at once with the syntax as in Q1:3A1-2 and Q1SQ1.3.4A1-2. Any range operation can be used.


EXAMPLES:


  • [show if Q1:3A1-2] - This is shorter and more convenient way of writing [show if (Q1A1 or Q1A2) and (Q2A1 or Q2A2) and (Q3A1 or Q3A2)]. The element would be shown if at least one of the first two items was selected in each of the questions 1, 2, and 3.
  • [show if Q1SQ1.3.4A1-2] - This is shorter and more convenient way of writing [show if (Q1SQ1A1 or Q1SQ1A2) or (Q1SQ3A1 or Q1SQ3A1)]. The element would be shown if respondent made selection at least once in A1 or A2 in subquestions 1 or 3.


Survey Flow Operations


In most cases you will use AYTM Logic to alter survey flow. To tell the platform what you want to happen, open the square bracket and type one of the following expressions or commands:



[Skip to...]


Will divert survey flow to the specified question. If this command contains conditionals, the survey flow will be altered if the condition is satisfied, otherwise the respondent will proceed to the next question in line. This command extends the "rabbit" functionalityavailable in the UI of the platform.


EXAMPLES:


  • [Skip to Q10] - will forward all respondents to question #10 after the question where this command resides
  • [Skip to Exit] - will forward all respondents to the end of the survey (while counting them as a valid complete)
  • [Skip to Q10 if Q5A2] - will forward respondents to question #10 if they selected second answer on the 5th question
  • [Skip to Q10 if @influencer] - will forward respondents to question #10 if they were aliased "influencer" previously in the survey
  • [Skip to Q10:15] - will randomly skip to any question in range Q10-Q15


[Show if ...]


This operation modifies visibility of a question or any subpart of it to respondents. [Show] unconditionally shows the element. With [Show if ...] you can specify under which conditions this element will be shown.


EXAMPLES:


  • [Show] - will unconditionally show an element where it's entered for all respondents. You don’t typically need this rule as all questions in the survey are set to be visible by default.
  • [Show if Q5A2] - this element will only be shown if respondent selected second answer on the 5th question


[Hide if ...]


This operation modifies visibility of a question or any subpart of it to respondents. [Hide] unconditionally hides the element. With [Hide if ...] you can specify under which conditions this element will be hidden.


EXAMPLES:


  • [Hide] - will unconditionally hide an element where it's entered for all respondents
  • [Hide if @influencer] - will hide the element for all respondents aliased "influencer"
  • [Hide if not @influencer] - will hide the element for all respondents NOT aliased as "influencer"


[Mask by...]


Mask operation is a shortcut for situations, when you want to show only items selected by respondent on an earlier question without the need to write [Hide if...] in every field.


EXAMPLES:


  • In the example below [mask by Q1] limits visible options to those that respondents selected in Q1. Please note the additional logic needed to hide the second question if respondent selected just one checkbox on the first question.




[Rev-mask by...]


[rev mask by ...] does a reverse operation of the [mask by ...] - it limits the elements to be displayed to those not selected in the referenced question.


EXAMPLES:


  • In the example below [rev-mask by Q1] limits visible options to those that respondents did not select in Q1. Please note the additional logic needed to hide the second question if respondent selected just one checkbox on the first question.



Please note: In both mask by... and rev-mask by… logic it’s important to keep in mind that platform will not compare the literal match of answers in the referred and marked questions. It will hide or show answer choices based on their numbers in the editor. For example, if Q1A1 was selected, Q2A1 will be shown etc. Please make sure that you keep the items and their order as appears in the editor - synchronized. This also gives you control over altering the wording if needed. For example, if on the first question “Which of the following sports do you practice regularly?” respondent has selected Q1A1 “Skiing”, on the second masked question you may want to ask it a bit differently: “If you had to choose, what would you rather do?” with answer: Q2A1: “Ski”...



[Group ...]


Allows you to group certain questions or batteries of questions within the survey and control how many batteries each respondent should answer before exiting the group. Please note: this logic can be added in any field of the survey but we recommend adding it to the first question or at the beginning of the group itself.


EXAMPLES:


  • [group Q5-10 and Q11-12 and Q13-Q18 max 2] This logic is placed in one of the fields in the beginning of the survey. Three "nodes" - batteries of questions are defined: Q5 through Q10; Q11, Q12; Q13 through Q18. Note that the batteries are defined with ranges, with the OR variants. The batteries are connected with the AND operator. The last piece "max 2" defines that the respondent will enter two nodes out of the three. Once respondent enters any of the mentioned questions in a normal survey flow, this logic activates, and throws them to the two randomly selected batteries. When respondent completes the requirement, they will continue along the normal survey flow. The respondent will proceed to the first unseen question - most likely Q19 in this example.


Priority


Rules with higher priority will override conflicting rules with lower priority. AYTM Logic (1) is the highest.


  1. 1. AYTM Logic. Rules described above.
  2. 2. RABBITS. Navigation, controlled by skips, set up in the editor’s UI (both direct & random modes)
  3. 3. ORGANIC FLOW. By default - questions are shown sequentially from the first one to the last one.


Glossary


[...]

- AYTM logic must always be surrounded by square brackets

Q

- question

SQ

- subquestion

E

- entity

A

- answer

R

- response

Rn

- number of responses

Rc

- all comments, comma separated

Ri

- first image

c

- comment

i

- image

@

- field alias

or

- “or” operator

.

- alternative “or” operator

-

- alternative “or” operator - used for ranges

and

- “and” operator

,

- alternative “and” operator

:

- alternative “and” operator - used for ranges

+

- add

-

- subtract

>

- greater than

<

- smaller than

>=

- greater or equal than

<=

- smaller or equal than

=

- equal to

!=

- not equal

not

- negative condition statement

1

- numeric value or a variable, number of a field

“one”

- string value of a custom variable (can contain any symbols as long as it’s in quotes)

(...)

- operations in parentheses will be processed before others

[Show]

- show a field

[Hide]

- hide a field

[Show if...]

- show a field if a condition is met

[Hide if...]

- hide a field if a condition is met

[Skip to...]

- skip to a destination if a condition

[Skip to… if]

- skip to a destination if a condition is met

[Mask by...]

- mask a question based on selected answers to an earlier question

[Rev-mask by...]

- mask a question based on non-selected answers to an earlier question

[Group...max...]

- create nodes, group them together, show them randomly to respondents and limit the number of nodes per respondent

[VarName...]

- a way to introduce a custom variable where VarName can be anything you choose using (A-Z, a-z, 0-9 and the underscore symbol "_")

[[Anything]]

- a way to show respondent any regular phrase in square brackets



EXAMPLES:


[PQ1]

- Reference to first prequalification question

[Q1]

- Reference to the first question

[Q1A1]

- Reference to the first answer of the first question

[Q1SQ1A1]

- Reference to the first answer of the first sub-question of the first question

[Q1E1SQ1A1]

- Reference to the first answer of the first sub-question (attribute) of the first entity of the first question. Relevant in Competitive Topography and Quadrant questions.

[Q1i]

- Reference to the image, attached to the first question

[Q1R]

- Reference to all responses, given by respondent to the first question

[Q1R1]

- Reference to the first response, given by respondent to the first question

[Q1Rn]

- Number of response, chosen by respondent on the first question

[Q1R1c]

- Comment, entered by respondent on their first response on the first question

[Q1Rc]

- All comments, entered by respondent on the first question

[Q1R1i]

- Image, associated with the first response, chosen by respondent on the first Q

[uuid]

- Reserved variable returning Unique User ID (if available)

[var1]

- Reserved variable returning first custom variable, passed through the survey link (if available)

[var2]

- Reserved variable returning second custom variable, passed through the survey link (if available)

[var3]

- Reserved variable returning third custom variable, passed through the survey link (if available)

[platform]

- Reserved variable returning type of respondent’s operating system (windows, mac, linux, ios, android, windows_mobile, windows_phone, other)

[device]

- Reserved variable returning type of respondent’s device (undefined, pc, mobile, tablet)

[browser]

- Reserved variable returning type of respondent’s browser (chrome, opera, firefox, ie, electron, safari, edge)

[gender]

- Reserved variable returning type of respondent’s gender (f, m)

[household_income]

- Reserved variable returning type of respondent’s HHI (0-25k, 25k-50k, 50k-75k, 75k-100k, 100k-200k, 200k-500k, 500k+)

[education]

- Reserved variable returning type of respondent’s highest education (professionaldegree, nocollege, somecollege, 2yrdegree, 4yrdegree, gradschooldegree)

[age]

- Reserved variable returning type of respondent’s current age (0-99)

[parental_status]

- Reserved variable returning type of respondent’s parental status. Digit represents number of kids (n/a, 0, 1, 2, 3, 4, 5+)

[relationship_status]

- Reserved variable returning type of respondent’s relationship status (single, married, marriedwch, singlewch, widowed, significantother, engaged, divorced, complicated)

[ethnicity]

- Reserved variable returning type of respondent’s ethnicity (whiteamerican, africanamerican, nativeamerican, asianamerican, latinoamerican, multiracial, other, indianamerican)

[employment_status]

- Reserved variable returning type of respondent’s employment status (fulltime, parttime, retired, unemployed, student)

[career]

- Reserved variable returning type of respondent’s career (acc/fin/bank, adv/design, arts/ent, clerical, healthcare, hospitality, it, legal, management, military, publicsafety, realestate, retail, smbusiness, student, other)



Misc


If you want to use square brackets in your survey in a way that is visible to the respondents, please use double square brackets. If you type: [[optional]] in a field, respondent will see [optional].


AYTM Logic is case insensitive, so [Q1I] would behave the same way as [q1i].


It is possible to have two or more logic commands together, e.g. [show if Q2][hide if Q1A4][Q1i]. The system independently resolves the logic elements, and, if needed, combines them together with a logical AND operator. Let's see how it would work:

  • The system would fetch an image from the Q1.
  • If respondent saw Q2 and did not select Q1A4, this element will be shown.
  • If respondent didn't see Q2 and selected Q1A4, this element will not be shown.
  • If respondent saw Q2 and selected Q1A4, the system would resolve these operations to "show" (true) and "hide" (false). Combining those with an logical AND operator, we get "hide" (false), thus the element will be hidden


Brackets can be used to group the logic into logical chunks, connected with "and", "or", and other operators, e.g. [Q1i if (Q1A1 or Q2A1) and not (Q3A1 or Q4A1)] .