Use [glue ...] logic to keep specific items together in a randomized list. For example, you can randomize a list of beverages while keeping all the coffee drinks next to each other. You choose whether the glued items keep the order you list them in or shuffle within their group.
Learn more about Glue logic in the Advanced Logic course in the Lighthouse Academy!
In This Article
- How Glue works
- Glue syntax
- Glue Logic Example
- What you can glue
- Glue with a condition
- Tips and troubleshooting
How Glue works
For each respondent, the survey builds the list in two steps:
- Randomize. If Randomize is on for the list, the items are shuffled. Items with Lock position stay where they are.
- Glue. The survey finds the first item listed in your glue rule and moves the other glued items next to it. The group takes that item's spot.
For example, with [glue Q1A1,2,3], if randomization puts A1 in the 4th position, A1, A2, and A3 appear together, starting at the 4th position.
💡 Tip: Glue works without randomization too. If Randomize is off, the glued items are still pulled together at the first listed item's position. That lets you reorder items. For example,
[glue Q1A1,6]shows A6 right after A1.
Glue syntax
The basic format is [glue Q#A…]. Name the question, then the items, as a list or a range. The separator controls the order of the items inside the glued group.
| Syntax | Result |
|---|---|
[glue Q1A2,3,4] |
Comma (AND): A2, A3, and A4 stay together in the order you list them. |
[glue Q1A2:4] |
Colon range: same as Q1A2,3,4. A2 through A4 stay together, in order. |
[glue Q1A2.3.4] |
Dot (OR): A2, A3, and A4 stay together, in random order. |
[glue Q1A2-4] |
Dash range: same as Q1A2.3.4. A2 through A4 stay together, in random order. |
[glue Q1A5,2] |
The order you list them in wins, so A5 appears first and A2 right after it. |
[glue Q10SQ1,3] |
Sub-questions (rows) 1 and 3 of Q10 stay together, in that order. |
[glue PQ1A1,2] |
Works in screening (pre-qualifying) questions too. |
Commands are not case-sensitive. [Glue Q1A1,2] and [glue q1a1,2] do the same thing.
⚠️ Note: Each glue rule takes one list or one range, with one kind of separator.
[glue Q1A1,2.3](mixed separators),[glue Q1A1-3,5](range plus list), and[glue Q1A1](a single item) are invalid. To glue two separate groups, write two rules, as in the example below.
Glue Logic Example
Say you're asking respondents about their preferred morning beverage. You want to randomize the list but keep the coffee drinks together and the tea drinks together.
- Type the question text and answer choices into the editor:
- A1 Latte, A2 Black coffee, A3 Espresso (coffee)
- A4 Smoothie (not glued, so it moves freely)
- A5 Black tea, A6 Green tea (tea)
- Select the Randomize checkbox for the question's answers.
- Type the Glue logic into the question text field:
-
[Glue Q1A1,2,3]keeps Latte, Black coffee, and Espresso together, in that order. -
[Glue Q1A5,6]keeps Black tea and Green tea together, in that order. - Final logic:
[Glue Q1A1,2,3] [Glue Q1A5,6]
-
- Click Quick preview in the left sidebar to check that the logic works as expected. Open the preview a few times to see different random orders.
Here is one order a respondent might see:
- Smoothie
- Black tea
- Green tea
- Latte
- Black coffee
- Espresso
The two groups and A4 shuffle relative to each other, but each group stays together and in its listed order. To also shuffle the drinks within each group, use dots instead: [Glue Q1A1.2.3] [Glue Q1A5.6].
What you can glue
Glue works on any list that the survey can randomize:
| Reference | Where it applies |
|---|---|
| Answers (A) | Radio buttons, Checkboxes, screening questions, Reorder (ranking), Side-by-Side, Forms fields, Progressive Matrix answer options, Shelf Test and Ecommerce products, Rapid Association attributes |
| Sub-questions (SQ) | Rows in Sliders, Progressive Matrix, Star rating, Smiley rating, Distribute, and Polarity Scale; attributes in Quadrant Analysis and Topography |
| Entities (E) | Entities in Quadrant Analysis and Topography |
Glue with a condition
Add if to glue items only for some respondents. Everyone else sees the list without that glue rule.
-
[glue Q5A1,2,3 if Q2A1]keeps A1–A3 of Q5 together only for respondents who chose A1 in Q2.
The condition can only use answers from questions the respondent has already reached.
Tips and troubleshooting
- Put the rule in the question it changes. Glue acts on the question named in the reference, wherever you type it. A condition is checked against the question where the rule is written, though, so a conditional glue in another question can fail with a connection error. Writing glue in the target question's text keeps it easy to find.
-
Write ranges from low to high.
[glue Q1A2:4]works.[glue Q1A4:2]glues nothing. To reverse the order, list the items:[glue Q1A4,3,2]. - Don't put the same item in two glue rules. Each rule runs in turn, so the second rule can pull the item away from the first group.
- Watch Lock position items. Glue moves every item it names, including an item with Lock position on. For example, gluing a locked "Other" to A1 pulls "Other" away from the bottom of the list.
- Glued items move as one unit. The group lands where its first listed item was randomized to. A large group can push the other items further down the list.
- Check in Quick preview. Each preview randomizes again, so open it several times to see the glued groups hold together.