How can we help you?

Working with Arrays and Lists in Workflows

Working with Arrays and Lists in Workflows

What is an Array Variable?

An array variable stores multiple values in a single variable — like a shopping cart, a list of selected services, or a set of tags. In Velaro workflows, arrays are stored as JSON strings.

Example: if a visitor selects "Oil Change" and "Tire Rotation" from a multi-select question, the answer is stored as:

["Oil Change","Tire Rotation"]

---

How to Collect a List from a Visitor

Use the Ask Question → Multiple Select node.

1. Add an Ask Question node to your workflow

2. Set Question type to Multiple Select

3. Add your options (each option has a label shown to the visitor and a value stored internally)

4. In the Save to Variable field, name the variable — e.g. selectedServices

5. The visitor's full selection is stored as a JSON array: ["Oil Change","Tire Rotation"]

Selection limits

Field What it controls
Minimum Fewest choices the visitor must make before continuing
Maximum Most choices allowed — leave blank for no limit

---

Dynamic Options (loading a list from a variable)

Instead of typing options manually, you can load them from a variable at runtime — useful when options come from a CRM, product catalog, or API call.

1. In the Multiple Select node, open Advanced options

2. Switch Options Source to From variable

3. Click the variable picker button (the { } icon) to choose your variable — or type <<variableName>> directly

Format required: The variable must contain a valid JSON array. Each item must have a label (shown to the visitor) and a value (stored when selected).

[
  {"label": "Oil Change", "value": "oil_change"},
  {"label": "Tire Rotation", "value": "tire_rotation"},
  {"label": "Brake Inspection", "value": "brake_check"}
]

To populate this variable from an integration, use an HTTP Request node or a workflow skill that returns a list, then store the result in the variable before your Multiple Select node.

---

Reading and Using Array Values

The stored answer is a JSON array string. You can use it in several ways:

Passing the whole list to AI or a message

Reference the variable normally: <<selectedServices>>

Velaro will pass the raw JSON array to the AI or message. The AI understands the format and can list the items naturally.

Parsing individual items

The array does not support indexed access like <<selectedServices[0]>> — that syntax is not supported.

To extract individual values, use a Set Data node:

1. Add a Set Data node after your Multiple Select node

2. Use a JavaScript expression (if enabled) to access items, e.g.:

   JSON.parse(<<selectedServices>>)[0]

3. Store the result in a new variable

Passing to an integration or HTTP request

Use the variable directly in an HTTP Request body:

{
  "services": <<selectedServices>>,
  "customerId": "<<contactId>>"
}

The array is inserted as a native JSON array (not a string), so the receiving API gets a proper array.

---

Large List Handling

When your list has more options than a channel can display at once (IVR: 5, SMS/WhatsApp: 10, web chat: unlimited), Velaro handles overflow automatically.

When list exceeds channel limit setting:

Option What happens
Auto (recommended) Sends a clickable link if the channel supports it; falls back to paginating the list into multiple messages
Always paginate Always breaks the list into pages of supported size — good for IVR
Send link to customer Sends the full list as a link first; paginates only if the channel can't send links

Pagination: The visitor is shown a numbered set of options and can request the next page. Their final answer is still stored as a single array.

---

Common Patterns

Let a visitor pick services, then route by selection

1. Multiple Select node → save to <<selectedServices>>

2. Condition node — check if <<selectedServices>> contains a specific value

3. Route to different branches based on the condition

Load options from HubSpot or Salesforce

1. HTTP Request node → call your CRM API, store result in <<crmOptions>>

2. Set Data node → transform result into [{"label":…,"value":…}] format, store in <<formattedOptions>>

3. Multiple Select node → set Options Source to From variable, pick <<formattedOptions>>

Send selections to a CRM after collection

1. Multiple Select node → save to <<selectedItems>>

2. HTTP Request node → POST body includes "items": <<selectedItems>>

---

Moshky AI — asking about array data

Moshky understands array variables in workflow context. You can ask:

  • "Show me workflows that collect multi-select answers"
  • "What variables are arrays in workflow X?"
  • "Help me set up a product picker that loads from an API"
  • "How do I check if a visitor selected a specific item?"
Share: Email

Was this article helpful?