Pick, Filter and Total Lists with the Array Formatter

Some data arrives as a list: the products in an order, rows in an API response, or items returned by a custom webhook. Array Formatter extracts what you need from that list without any code.

Where lists come from

Store order triggers, the Inbound Webhook trigger, and the response of a Custom Webhook action. Array Formatter works with flat lists only, not nested lists.

Function types

  • Find: returns the one object that matches a key and value, such as a line item with a specific product ID.
  • Find by Index: returns the item at a position. Counting starts at 0, so index 2 is the third item.
  • Filter: returns every object that matches, such as all items in the "home" category.
  • Line Items: rebuilds the list into a new shape for a destination such as a webhook, a spreadsheet or an email cart.
  • Math: Sum, Min, Max, Average or Count of numbers in the list.

Set it up

  1. Click + and choose Array Function (Array Formatter).
  2. Select the function type and review its description and return type.
  3. Choose the input list, then enter the key, value or index.
  4. Save and test. The result becomes a variable for later steps.

Example

An order trigger delivers five line items. Use Math > Sum on the price key to get an order total, then branch with If/Else when the total exceeds a threshold and notify your sales team.

Good to know: You can chain several Array Formatter steps together, using one result as the input to the next.

Was this article helpful?