aytm Logic is a simple yet powerful way to program surveys on the platform, covering everything from simple skip logic and piping to advanced needs including custom variables, references, monadic survey design, groups, and more. Using simple language statements written in [square brackets] right in the survey fields, you can build a tailored survey experience for respondents while keeping full control of how data is collected and compiled for analysis.
In This Article
- What You Can Do with aytm Logic
- How aytm Logic Works
- Logic Priority
- Tools That Help You Write Logic
- Logic Topics by Task
- Video Walkthroughs
What You Can Do with aytm Logic
Here are a few examples of what you can do with aytm Logic:
- Show or hide a question or answer if a respondent has selected a specific answer on another question
- Pipe in top answer text from a ranking question
- Skip a respondent to the end of the survey if specific conditions are met
- Modify question text based on a cluster a respondent is assigned to as a result of a typing tool section or other conditions
- Set up sequential monadic studies—show each respondent 3 batteries of questions out of 15 total batteries in a group
- Program a quiz, track progress, and display customized results screens at the end
Learn more about aytm Logic in the Lighthouse Academy!
How aytm Logic Works
You write aytm Logic directly into the fields of your survey in the Survey Editor—question text, answer options, and subquestions. Type a left square bracket [ in any field to start a statement. A statement applies to the field you type it into: put [Show if…] in an answer option to show or hide that answer, or in the question text to show or hide the whole question.
The Building Blocks
Most statements combine a command with one or more references to earlier parts of the survey.
| Reference | What it points to |
|---|---|
| Q# | A question, by its number in the survey (e.g., Q3) |
| PQ# | A prequalification question |
| SQ# | A subquestion (row) in a matrix-style question |
| A# | An answer option (e.g., Q2A1 is answer 1 of Q2) |
| R | The response a respondent gave |
| i / c | An image, or a comment (optional open-ended answer) |
| @alias | A hidden name you give a question or answer so you can reference it in logic |
For the full list of references, commands, and operators, see the aytm Logic Glossary.
Example Statements
| Statement | What it does |
|---|---|
[Show if Q2A1] |
Shows the field only to respondents who selected answer 1 in Q2 |
[Hide if Q1A4] |
Hides the field from respondents who selected answer 4 in Q1 |
[Skip to Q5 if Q2A3] |
Sends respondents who selected answer 3 in Q2 straight to Q5 |
[Skip to exit] |
Sends respondents to the end of the survey when they click Next |
[Q1R] |
Pipes in the respondent's answer to Q1 |
[group Q1-3 and Q4-6 and Q7-9 max 2] |
Randomly assigns each respondent 2 of the 3 question sets (monadic design) |
Syntax Rules to Know
-
Not case sensitive.
[Show if Q2A1]and[show if q2a1]behave the same. -
Statements can be combined. You can put several statements in one field, e.g.,
[show if Q2][hide if Q1A4]. Each one is evaluated separately, and the field is shown only if all of them allow it (AND). -
Parentheses group conditions. For example,
[Show if (Q1A1 or Q2A1) and not Q3A1]. -
Double brackets show literal brackets. Type
[[optional]]and respondents see [optional]. - Logic doesn't count toward character limits. Statements are not included in a field's character count.
Logic Priority
When rules conflict, the one with the higher priority wins:
- aytm Logic—statements written in square brackets (highest priority)
-
Rabbits—skips set up with the rabbit icons in the Survey Editor (Direct and Random modes)
- Organic flow—by default, questions are shown in order from first to last
⚠️ Note: If your survey uses other aytm Logic, write your skips as statements (e.g.,
[Skip to Q5 if Q2A3]) instead of using rabbit icons, so all of your survey flow lives in one place.
Tools That Help You Write Logic
aytm Logic Guide
Click the aytm Logic guide icon in the menu along the right side of the Survey Editor to search for syntax with descriptions and examples, copy a statement with one click, or drag a live Logic example into your survey. See How to Use the Built-in Logic Guide.
aytm Logic Autocomplete
When autocomplete is on, typing [ in a field suggests commands and references as you type. You can switch it on or off with the aytm Logic autocomplete toggle in the settings panel below the survey title. See How to Use Autocomplete Logic.
Error Highlighting
The Survey Editor checks your statements as you type and highlights problems. Hover over a highlighted statement to see the message.
| Highlight | What it means |
|---|---|
| Red | The statement isn't valid syntax ("… is not a valid aytm Logic rule"). Check spelling, brackets, and operators. |
| Orange | The statement references something that doesn't exist, such as a question number that isn't in the survey ("Referred field … doesn't exist in this survey"). |
| Deleted reference | A field the statement referenced was changed or deleted. Edit the statement, or click OK here or OK here and elsewhere in the popup to accept the change. |
⚠️ Note: aytm Logic is a plan feature. If your plan doesn't include it, Logic statements are highlighted with an upgrade message ("Upgrade to … and launch survey with the aytm Logic").
💡 Tip: To review your logic outside the editor, download the survey draft and select Include [aytm Logic markup].
Logic Topics by Task
Each of these articles covers one area of aytm Logic in depth.
| I want to… | Read |
|---|---|
| Change the path respondents take | Skip Logic, Direct vs Random Skip Logic |
| Reuse earlier answers, text, or images | Piping Logic, Masking Logic |
| Run a monadic or sequential monadic design | Group Logic, Nested Group Logic, Controlling Group Logic with Custom Array |
| Randomize or reorder questions and answers | aytm Logic: Randomization and Glue, Sort Logic, aytm Logic: Sort by array |
| Score answers or build a quiz | Scoring Logic, Punch Logic |
| End or screen out a response | Terminate Logic, Using Logic to End a Response |
| Control how many respondents fall into a segment | Custom Quota Logic, Examples of Custom Quota Logic |
| Use demographic data in logic | Demographic Trait reference logic, Referencing Race/Ethnicity through Logic |
| Make answers mutually exclusive | Exclusive Logic |
Video Walkthroughs
Prefer to watch instead of read? Each of these covers a different slice of aytm Logic.
Logic Overview
A general walkthrough of what aytm Logic is and how it fits into your survey.
Overview & Survey Flow
How Logic statements control the path a respondent takes through your survey.
Operators
A short look at the operators available for writing conditional Logic statements.