Shelf logic controls which products appear on each shelf and how they're arranged. It allows you to define product placement, create multiple facings, and customize shelf layouts to match your research objectives.
When you arrange products in the Shelf Planogram Visual Editor, shelf logic is automatically generated as you place and position products. You can build your shelf visually by dragging products into place without needing to write any logic yourself.
For more precise control, you can enable Show logic text within the Visual Editor to view and manually edit the automatically generated logic. This is particularly useful for creating complex planograms or defining different shelf arrangements based on respondents' earlier answers.
All shelf arrangements and logic are managed within the Shelf Planogram Visual Editor. You do not need to enter shelf logic in the Question text field.
Learn how to arrange products in the Shelf Editor.
Learn more about Shelf Test in our Lighthouse Academy course!
In This Article
- Creating Shelf Logic in the Visual Editor
- Understanding Shelf Logic Syntax
- Shelf Alignment Options
- Displaying Multiple Product Facings
- Club Store Shelf Logic
- Custom Shelf Configurations
- Troubleshooting Shelf Logic
- Preview Your Shelf Test
Creating Shelf Logic in the Visual Editor
- Open your Shelf Test question in the Survey Editor.
- Click Arrange to open the Shelf Planogram Visual Editor.
- With shelves configured, click the Show logic text toggle to view the automatically generated logic text.
- Edit the shelf logic to change where products appear.
-
Click Apply to update the arrangement, or Revert to discard your unapplied changes.
Apply is available once the text is valid. An error message explains anything that needs fixing. If the result isn't what you wanted, click Undo.
Understanding Shelf Logic Syntax
Shelf logic references products by their answer choice numbers in the Shelf Test question.
A basic shelf statement looks like this:
shelf {1,2,3},{4,5,6}
In this example:
-
shelfdefines the alignment of the products. Left, Center, Right, or Shelf-flex -
{1,2,3}places products 1, 2, and 3 on the first shelf. -
{4,5,6}places products 4, 5, and 6 on the second shelf.
Each set of braces represents a shelf, and the numbers inside represent the products assigned to it.
Counting Shelves
Shelves are counted from top to bottom within each section, then continue from one section to the next.
For predictable placement, include one set of braces for each shelf in your arrangement.
- If your logic includes fewer shelves than your configuration, the remaining shelves are left empty.
- If your logic includes more shelves than your configuration, the extra shelves and their products are ignored and may trigger a validation error.
Leaving a Shelf Empty
To leave a shelf empty, include an empty set of braces {}.
For example:
shelf {1,2},{},{3}
This arrangement places products 1 and 2 on the first shelf, leaves the second shelf empty, and places product 3 on the third shelf.
Shelf Alignment Options
Alignment controls how products are positioned and spaced across shelves.
For standard arrangements, select the alignment directly in the Visual Editor. When writing shelf logic, use the corresponding command.
| Logic command | Alignment | Description |
|---|---|---|
shelf |
Center | Centers products on each shelf. This is the default alignment. |
shelf-center |
Center | Same behavior as shelf. |
shelf-left |
Left | Aligns products to the left side of each shelf. |
shelf-right |
Right | Aligns products to the right side of each shelf. |
shelf-flex |
Shelf-flex | Distributes spacing between products, with a price tag for each facing. |
shelf-group |
Shelf-flex with One price tag per product | Distributes spacing between products but displays one price tag per group of identical facings. |
For example:
shelf-group {1,1,1},{2,2,2},{3,3,3}
This arrangement displays three facings of each product, with one price tag per product group.
⚠️ Note: Alignment applies to the entire Shelf Test question, rather than individual shelves.
Displaying Multiple Product Facings
A facing is one visible instance of a product on a shelf. You can display the same product multiple times to recreate realistic shelf arrangements.
In the Visual Editor, you can add multiple instances of a product to a shelf or use the available Fill style settings with Auto-arrange.
When writing shelf logic, repeat the product's answer choice number for each facing.
For example:
shelf {1,1,2,3}
This displays two facings of product 1, followed by one facing each of products 2 and 3.
Club Store Shelf Logic
Club store pallets use a different shelf structure from standard retail shelves.
Products are assigned from left to right across the top level, then continue across the levels below it. The number of shelf groups required in written logic depends on the pallet configuration selected.
You can configure pallet dimensions and structure directly in the Visual Editor.
Use Auto-arrange, which is on by default in the pallet view, and click Arrange. Products are placed in answer order, from left to right across the top level and then across the levels below it. Use Fill style to control how much room each product gets.
In the Visual Editor, hover over a level to change its height and stacking, or to + Add or Remove a level. To change how many pallets sit side by side or how many levels there are, use the pallet dropdown in the question's options panel.
For more information about club store shelf arrangements, see Club Store Shelves Reference.
Custom Shelf Configurations
Shelf dimensions, hanging shelves, section widths, and other fixture settings are configured directly in the Shelf Planogram Visual Editor.
The legacy [[shelfconfig]] marker is no longer needed. You do not need to enter configuration markers in the Question text field. Always edit logic from the Visual Editor.
For more information, see How to Arrange Products in the Shelf Editor.
Troubleshooting Shelf Logic
If your shelf arrangement isn't displaying as expected, review the following common issues.
| Issue | What to check |
|---|---|
| Products are missing | Confirm that the products you want to display are included in your arrangement. |
| Incorrect number of shelves | Check that your logic matches the number of shelves configured in the Visual Editor. |
| Products don't fit | Check product dimensions and available shelf space. You may need to widen a section or adjust product sizes in their Product Cards. |
| Shelf height is too small | Shelves below the minimum supported height are highlighted in the editor. |
| Total fixture height is too small | Use the editor's suggested height adjustment to meet the minimum requirements. |
| Unsupported hanging shelf | Confirm that the selected store and fixture support hanging shelves. |
Preview Your Shelf Test
Before launching your survey, use Quick Preview to confirm that products appear in the intended positions, fit within the shelf dimensions, and display correctly for respondents.