Skip to main content

Using Array Functions in Workflows

Array Functions are premium workflow actions used to find, filter, rebuild, or calculate values from arrays in Kyrios workflows.

What Array Functions Do

Array Functions handle array data in workflows.

An array is a list of data. In workflows, arrays commonly appear as lists of objects, such as order line items.

Array Functions can:

  • Find one matching item

  • Find one item by position

  • Filter multiple matching items

  • Rebuild line item data

  • Run math calculations on numeric values

Array Functions are premium actions and may incur charges per execution.


How to Add an Array Functions Action

  1. Go to Automation.

  2. Open Workflows.

  3. Click Create Workflow or open an existing workflow.

  4. In the workflow builder, click Add Action.

  5. Select Array Functions from the action list.

  6. Open the Action Type dropdown.

  7. Choose one action type: Find, Find by index, Filter, Line Items, or Math Functions.

  8. Configure the fields required for the selected action type.

  9. Click Save Action.

Select Field

The Select Field dropdown is where you choose the array that the action should process.

For example, if the workflow uses Shopify order data, you may select Line Items as the array field.

Using Array Function Outputs

After an Array Functions action runs, Kyrios creates output values that can be used later in the workflow.

Use the custom values picker to insert Array Functions output into another workflow action.


Find

The Find action returns the first object in an array that matches a key-value condition.

Use Find when you only need one matching item.

Example: Find whether a specific product ID exists in Shopify line items.

Find returns one object only. If multiple objects match, Kyrios returns the first matching object.

Find by Index

The Find by index action returns one item based on its position in the array.

Array positions start at 0.

Example:

  • Index 0 = first item

  • Index 1 = second item

  • Index 2 = third item

Use Find by index when the item’s position is known.


Filter

The Filter action returns all objects in an array that match one or more filter conditions.

Use Filter when you need multiple matching items.

A filter condition includes a key and a value.

Example: Filter line items where the id matches a specific user, product, or dynamic workflow value.

Line Items

The Line Items action rebuilds an array into a custom structure.

Use Line Items when another action needs data in a specific format, such as:

  • A custom webhook

  • Google Sheets

  • An email shopping cart layout

  • A formatted order summary

Line Items takes an input array and outputs a new array using the fields you define.


Math Functions

The Math Functions action runs calculations on numeric values inside an array.

Use Math Functions to calculate values such as total price, minimum price, maximum price, average price, or item count.

Available math operations:

  • Sum: Adds all values and returns the total.

  • Min: Returns the smallest value.

  • Max: Returns the largest value.

  • Average: Adds all values and divides by the number of values, returns the mean.

  • Count: Returns the total number of values.


Common Issues and Fixes

The Select Field dropdown is empty

The workflow may not have array data available yet. Use a trigger or action that provides array data, such as Shopify data, an inbound webhook, or a custom webhook response.

The action returns no result

The key or value may not match any item in the array. Check the exact key name, value format, and dynamic value used in the action.

Find returns only one item

This is expected behavior. Use Filter if you need all matching items instead of the first matching item.

Find by index returns the wrong item

Array index positions start at 0, not 1. The first item is index 0.

FAQ

What type of data can be used with Array Functions?

Array Functions work with arrays, which are lists of objects or numbers. Arrays commonly come from Shopify triggers, inbound webhooks, and custom webhook response data.

Are Array Functions a premium feature?

Yes. Array Functions are premium workflow actions and may incur charges when they run.

Can Array Functions handle nested arrays?

No. Array Functions are designed for flat arrays. Nested data may require custom handling.

Can I use multiple Array Functions in one workflow?

Yes. You can use multiple Array Functions in the same workflow and use the output from one action in later actions.

How do I debug Array Functions?

Use Test Workflow and review the action output. Confirm that the selected array, key, value, and action type are correct.

Did this answer your question?