Data & variants
Docs/Data & variants

Objects, arrays and tables

Group fields with Object, define lists with Array, and render each element with each.

3 min read4 sections
On this page

Use an Object to group related fields, and an Array for a list. This structure lets HTML read individual values and create content for each element supplied to the template.

This guide starts with recipient details, adds a list of items, and renders that list as table rows.

1. Group fields with Object

In Parameters → Schema, add recipient, choose Object, and add two Text fields: name and email.

The data looks like this:

{
  "recipient": {
    "name": "Tembuilder",
    "email": "[email protected]"
  }
}

Read nested fields with dot notation: {{ params.recipient.name }} and {{ params.recipient.email }}.

Parameters
SchemaPayload
⌄ recipientObject
nameText
emailText
+ Add field
recipient · Object → name / email

2. Declare a list with Array

Add items, choose Array, and set its element structure to Object. Add a Text name and Number quantity to that structure.

{
  "items": [
    { "name": "Item A", "quantity": 2 },
    { "name": "Item B", "quantity": 1 }
  ]
}

Declare the item’s fields once; they apply to each element in the list. Supply an actual array rather than putting the whole JSON list in a Text field.

Parameters
⌄ itemsArray
Item schemaObject
nameText
quantityNumber
Array → item structure → nested fields

3. Generate table rows with each

Use an each loop in section HTML:

<table>
  <thead><tr><th>Item</th><th>Quantity</th></tr></thead>
  <tbody>
    {{#each params.items}}
      <tr><td>{{ name }}</td><td>{{ quantity }}</td></tr>
    {{else}}
      <tr><td colspan="2">No items yet</td></tr>
    {{/each}}
  </tbody>
</table>

Inside each, name and quantity belong to the current item. The else branch renders when the array is empty.

For a long table, put the header in <thead> and allow the section to split across sheets. See Long tables and pagination.

ItemQuantity
Item A2
Item B1
{{#each params.items}} {{ name }} · {{ quantity }}{{else}} No items yet{{/each}}
each renders each item · else handles an empty list

4. Lists without nested fields

For simple values, set an array’s element type to Text, Number, or Boolean instead of Object. For example, tags is an array of Text:

{ "tags": ["Design", "Review", "Approved"] }

Use this to read the element itself inside the loop:

{{#each params.tags}}
  <span>{{ this }}</span>
{{/each}}

Object and Array data both appear in Payload, ready to copy into Run.

{ "tags": ["Design", "Review", "Approved"] }
DesignReviewApproved
Array of Text → use this to read each element

See the Handlebars syntax reference for conditions, scope, escaping, and advanced examples.

Search documentation