In most cases you'll use aytm Logic to change the survey flow or what respondents see on a question. Open a square bracket in any question, answer, or other field in the editor and type one of the commands below.
In This Article
- [Skip to...]
- [Show if...]
- [Hide if...]
- [Hide text]
- [Mask by...]
- [Rev-mask by...]
- [Group...]
- [Glue...]
- [Exclusive...]
- [Show first/last...]
- [Sort by a-z...]
[Skip to...]
Sends the respondent to the specified question if the destination will let this respondent in. If the command has a condition, the flow changes only when the condition is met; otherwise the respondent moves on to the next question as usual.
You can list several destinations. The system checks which of them this respondent can enter and sends them to a random one. A destination is unavailable if its [show if...] or [hide if...] logic keeps the respondent out, or if the respondent has already answered it. If no destination is available, the respondent continues normally.
-
[Skip to Q10]—sends all respondents to Q10 after the question that holds this command -
[Skip to Exit]—sends all respondents to the end of the survey (counted as a valid complete) -
[Skip to Q10 if Q5A2]—sends respondents to Q10 if they selected A2 on Q5 -
[Skip to Q10 if @influencer]—sends respondents to Q10 if they were aliased "influencer" earlier in the survey -
[Skip to Q10-15]—sends respondents to a random available question in the range Q10–Q15 -
[Skip to Q10 or Q12 or Q15]—sends respondents to a random available question out of Q10, Q12, and Q15 (the short form[Skip to Q10.12.15]works the same way)
⚠️ Note: Write question ranges with a dash (
Q10-15), not a colon.[Skip to Q10:15]is flagged as an error. A range can't include the question the command sits on, and it can't span more than about 50 questions.
[Show if...]
Controls whether a question, or any part of it, is visible. [Show] shows the element unconditionally. [Show if ...] shows it only when the condition is met.
-
[Show]—shows the element to all respondents (rarely needed, since elements are visible by default) -
[Show if Q5A2]—shows the element only if the respondent selected A2 on Q5
⚠️ Note: If a
[skip to...]points to a question with[show if...], respondents who don't meet the show condition aren't redirected. They continue to the question right after the one that holds the[skip to...].
[Hide if...]
Controls whether a question, or any part of it, is visible. [Hide] hides the element unconditionally. [Hide if ...] hides it only when the condition is met.
-
[Hide]—hides the element from all respondents -
[Hide if @influencer]—hides the element from respondents aliased "influencer" -
[Hide if not @influencer]—hides the element from respondents NOT aliased "influencer"
⚠️ Note: If a
[skip to...]points to a question with[hide if...], respondents who meet the hide condition aren't redirected. They continue to the question right after the one that holds the[skip to...].
[Hide text]
Doesn't change the survey flow. It hides an element's text from respondents, while the text stays visible to researchers on the statistics page. This is useful when you want a question title to show only an image but keep identifying text for analysis, or when Conjoint feature labels wouldn't make sense to respondents. It also lets you get past the editor's requirement that elements not be empty.
-
[Hide text]—hides the element's text from all respondents; the text still appears on the statistics page -
[Hide text if Q2]—hides the element's text if the respondent has seen Q2
[Mask by...]
A shortcut for showing only the items a respondent selected on an earlier question, without writing [Show if...] on every item. Place the command in the question you want to filter. [mask by Q1] in Q2 shows only the Q2 items whose matching Q1 items the respondent selected.
What gets filtered depends on the question type:
- Single-choice, multiple-choice, and ranking questions: answer options
- Grid questions (matrix, sliders, Progressive Matrix): rows (sub-questions)
- Topography: entities
Mask can't be used on question types without a list to filter, such as open-ended, image, and video questions. The editor shows "Mask rule is not allowed for this type of question". Mask commands also don't take an if condition.
⚠️ Note:
[mask by...]and[rev-mask by...]match items by their position in the editor, not by their text. If Q1A1 is selected, Q2A1 is shown, whatever either one says. Keep the items in the same order in both questions. If the masked question has more items than the source question, the extra items are always shown.
[Rev-mask by...]
The reverse of [mask by...]. It shows only the items whose matching items the respondent did not select in the referenced question.
-
[rev-mask by Q1]—shows only the options the respondent didn't select in Q1 -
[mask by Q1 except Q2A5]—placed in Q2, masks Q2 by Q1 but leaves A5 in Q2 alone. This also works withrev-mask. You can use ranges (Q2A5-7) and lists (Q2A1,7) afterexcept. Theexceptpart can only refer to the question that holds the command.
[Group...]
Groups questions into batteries and controls how many batteries each respondent answers before leaving the group. If a respondent can't enter a battery (for example, because of [hide] logic), the system tries another one until the maximum is reached or no batteries are left. That skipped battery doesn't count toward the maximum.
-
[Group Q5-10 and Q11-12 and Q13-18 max 2]—defines three batteries; each respondent sees two of them. Once they're done, the respondent continues to Q19.
A group has to follow these rules, or the editor flags it as an error:
- Batteries can contain only regular survey questions, not screening questions (PQs).
- Together, the batteries must form one continuous block of questions with no gaps or overlaps. For example,
Q5-10 and Q13-18is not allowed because Q11–Q12 are missing. - The
maxnumber can't be higher than the number of batteries.
💡 Tip: Group logic applies to the whole survey, so you can put it in any field. We recommend adding it to the first question of the group.
[Group... randfill]
By default, the system favors the batteries that have been filled the least so far. Add randfill to assign batteries completely at random instead.
-
[Group Q5-10 and Q11-12 and Q13-18]—all three batteries, least-filled first -
[Group Q5-10 and Q11-12 and Q13-18 randfill]—all three batteries in random order -
[Group Q5-10 and Q11-12 and Q13-18 max 2 randfill]—two batteries picked at random
[Group... balance...]
Add the balance keyword to spread the batteries evenly within each segment you list. Segments can be based on questions, answers, or demographic traits.
- Separate segments with commas.
- Inside a segment, write
and/orin full. Shortcuts such asQ5a8.9combine several answers into one segment. - The system automatically adds an "everyone else" segment for respondents who don't match any segment you listed.
-
[Group Q6-9 and Q10-13 and Q14-17 balance Q5a8, Q5a9, Q4a2]—spreads the three batteries evenly among respondents who chose Q5A8, those who chose Q5A9, and those who chose Q4A2 -
[Group Q6-9 and Q10-13 and Q14-17 balance gender = "f", gender = "m" max 1]—each respondent sees one battery, balanced across women and men -
[Group Q2 and Q3 balance gender = "f" and q1a1, gender = "f" and q1a2, gender = "m"]—balances across three combined segments
⚠️ Note: Balancing relies on the default least-filled mode. If you add
randfill, batteries are assigned at random andbalancehas no effect. Also, avoid listing more than 40 segments (or more than your sample size ÷ 10). With too many segments, each one gets too few respondents to balance well.
[Glue...]
When randomization is on, use [glue...] to keep specific items together. The glued block appears where its first listed item lands after randomization.
-
[glue Q1A2,3,4]or[glue Q1A2:4]—A2, A3, and A4 stay together, in that order -
[glue Q1A2.3.4]or[glue Q1A2-4]—A2, A3, and A4 stay together, in random order -
[glue Q10sq1,3]—sub-questions 1 and 3 in Q10 stay together, in that order
⚠️ Note: A comma (
,) or colon (:) keeps the items in order. A dot (.) or dash (-) shuffles them inside the block.
[Exclusive...]
Prevents answer options from being selected together. It works in multiple-choice questions, multiple-choice screening questions, and Progressive Matrix. When a respondent selects an answer that has [exclusive], the restricted options are cleared and grayed out. In Progressive Matrix they're only grayed out.
You can refer only to other answers in the same question. You can't refer to other questions, and an answer can't be exclusive to itself.
-
[exclusive all]—blocks selecting any other option (useful for "None of the above" or N/A) -
[exclusive Q1A1]—blocks also selecting A1 in Q1 -
[exclusive Q1A2,3]—blocks also selecting A2 or A3 in Q1 -
[exclusive Q1A1-3 if PQ1A1]—blocks also selecting A1–A3 in Q1 if the respondent answered A1 in PQ1
[Show first/last...]
Limits how many items a respondent sees in a question. The count is applied after show/hide logic and randomization, to the items this respondent would actually see. An N/A option counts as an item, so it can be cut off.
-
[show first 3 Q1A]—of the items the respondent would see in Q1, shows only the first 3 -
[show last 4 Q2E if q1a1]—shows only the last 4 entities in Topography question Q2, if the respondent selected A1 in Q1
[Sort by a-z...]
Sorts items alphabetically, ignoring case. Use a-z for ascending order (0, 00, 01, 1, 10, 2, 3, a, ab, b, c...) or z-a for descending order. Numbers are sorted character by character, so "10" comes before "2". The command always sorts the question it refers to, so you can place it on any question. N/A options stay where they are in the editor.
To set a custom order instead, use sort by array; see "Arrays: sort" in the aytm Logic Reference Guide.
-
[sort by a-z Q1A]—sorts the answer options in Q1 alphabetically -
[sort by z-a Q1SQ]—sorts the sub-questions in Q1 in reverse alphabetical order -
[sort Q1A by a-z except Q1A5]—sorts the answers alphabetically but keeps A5 in its original position. You can use ranges (Q1A5-7) and lists (Q1A1,7) afterexcept. Use this longer form (sort Q1A by a-z) when you needexcept; the short form (sort by a-z Q1A) doesn't accept it.