Liquid Code guide: Using the 'Setup' block

  • Updated

The Setup block is a Liquid code block, which must not produce any direct output. Using the Setup code block of an element allows for data to be referenced anywhere in the element itself.

The Setup block can be found in the Email Designer, within any content element. Simply click the element and scroll down on the right hand navigation.


  • Good for saving Liquid in Saved Elements, making logic reusable 
  • Keeps liquid out of view & out of the copy
  • Returned data is displayed in a dynamically generated grid


  • Logic placed here can only be referenced in the element and its child elements
  • When testing campaigns, it can be difficult to pick out what Liquid may be causing unexpected results
  • Calling for products via Liquid bypasses the de-duping that is built into dynamic grids, so there is risk for duplicate products to show up in campaign content if there is more than 1 dynamic grid

Using the Setup block of any element allows for data to be referenced anywhere in the element itself .


For this example we will use the liquid code:   {{b_data[0].name}}

The Liquid code is used inside the Setup block of this specific Section content element.


‘b_data’ is referenced in the Text element that lives inside the Section element where the ‘b_data’ logic was set up.

Note: Variables are created as the template processes Liquid in the Variables section first, then the subject line and preheader, and then every text element in the email from top-to-bottom. If you want to use Liquid in your subject line, put your Liquid in the Variables section!


Using the Setup block for a dynamic grid

  • Allows for data to be automatically iterated through and populate a dynamic grid
  • Allows querying beyond what is available in dropdown menu (Details tab > Source)
  • Allows for complex logic to be saved with the dynamic grid as a Saved Element
  • Example:

Lookup ‘b_data’ is assigned in the Setup block of a dynamic grid:


'b_data’ is then referenced. In the Details tab of the dynamic grid, navigate to Content > Convert to Liquid.


Additional Resources