---
title: "Expressions for arrays and objects"
slug: "expressions-for-arrays-and-objects"
updated: 2026-03-06T22:07:09Z
published: 2026-03-06T22:07:09Z
canonical: "support.tulip.co/expressions-for-arrays-and-objects"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Expressions for arrays and objects

*Learn the basics of working with arrays and objects in the Expressions Editor.*

Knowing what Expressions to use in order to work with Arrays is essential for working with data in Tulip. You can also use expressions to break down Objects into separate data types. This allows you to focus on specific data to inform your process in an application.

---

## Expressions with arrays

Several kinds of expressions perform different functions to return values. These values can be a single value or another array. They can also be the same data type or a different data type.

Some expressions use arrays to return simple arithmetic values:

**array_max()** Returns the maximum of a given numeric array.

![array_max expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_max%20expression.png)

**array_min()** Returns the minimum of a given numeric array.

![array_min expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_min%20expression.png)

**array_avg()** Returns the average of a given numeric array.

![array_avg expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_avg%20expression.png)

![Array Expressions - Max Min Avg](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array%20Expressions%20-%20Max%20Min%20Avg.gif)

Other expressions use standard deviation to return values.

**array_stdev_population()** Returns the standard deviation of the population of a given numeric array.

![array_stdev_population expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_stdev_population%20expression.png)

**array_stdev_sample()** Returns the standard deviation of the sample of a given numeric array.

![array_stdev_sample expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_stdev_sample%20expression.png)

![Array Expressions - StDev Pop Samp](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array%20Expressions%20%20-%20StDev%20Pop%20Samp.gif)

**array_at_value_index** Returns the value at the given index in the given list. If the index is out of bounds, returns null.

![array_value_at_index ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_value_at_index%20ex.png)

One of the most widely used expressions in the Tulip platform is:

**array_index_of()** Returns the index of the first occurance of the given value in the given array. If not found, returns “-1”.

![array_index_of expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/array_index_of%20expression.png)

![Array_Index_Of Ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array_Index_Of%20Ex.png)

As explained in [this community post](https://community.tulip.co/t/programmatically-connect-to-serial-devices-with-player-triggers/8133), you can use array_index_of() to determine a COM port on a serial driver. You could also use it for [Connector](/r230/docs/connectors) output results to find a particular work order.

**LEN()** Returns the number of items in an array. ![Len expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Len%20expression%20ex.png)

There are also expressions that use arrays to determine given values, such as:

**arraycontains()** Returns “true” if the given value is in the given array, returns “false” if otherwise.

![arraycontains expression yes](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/arraycontains%20expression%20yes.png)

![Array Expressions - Contains](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array%20Expressions%20-%20Contains.gif)

The following expressions use [regular expressions](https://regex101.com/) to return arrays. You can also use [this cheatsheet](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet) to understand regex capabilities and syntax.

**regex_match()** Returns an array of matches to the regular expression.

![regex_match expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/regex_match%20expression%20ex.png)

![regex_match expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/regex_match%20expression%20ex%20in%20app.png)

**regex_replace()** Returns a modified Array with string replacements defined in the expression.

![regex_replace expression ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/regex_replace%20expression%20ex.png)

![regex_replace expression ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/regex_replace%20expression%20ex%20in%20app.png)

Finally, you can combine multiple arrays with similar data types to create a new array.

**array_concat()** Concatenates any number of arrays of a single type into a single array of that type.

![Array_Concat Expression](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array_Concat%20Expression.png)

![Array_Concat Ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Array_Concat%20Ex.png)

## Expressions with objects

Expressions that use objects all have the same function in Tulip: gather data from one object and store it in another object that uses a single data type. The following expressions work similarly, using a given key (header) to convert an object array to a base array.

**map_to_boolean_list()** Converts an object array to a Boolean array for the given key. ![map_to_boolean_list ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/map_to_boolean_list%20ex.png)

**map_to_integer_list()** Converts an object array to an Integer array for the given key. ![map_to_integer_list ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/map_to_integer_list%20ex.png)

**map_to_number_list()** Converts an object array to a Number array for the given key.

![map_to_number_list ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/map_to_number_list%20ex.png)

**map_to_text_list()** Converts an object array to a text array for the given key. ![map_to_text_list ex](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/map_to_text_list%20ex.png)

In the example below, the object array has four data headings per object. The button trigger uses data manipulation to store data from each key (heading) into respective variable arrays (boolean, number, etc.).

![map to text ex in app](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/map%20to%20text%20ex%20in%20app.gif)

Using one of the above map_to_text expressions with array_index_of() allows you to extract information from a Connector Function Output.

---

Did you find what you were looking for?

You can also head to [community.tulip.co](https://community.tulip.co/?utm_source=intercom&amp;utm_medium=article-link&amp;utm_campaign=all) to post your question or see if others have solved a similar topic!

**Expression**

A configured code snippet that returns a calculated value based on certain inputs. **Expressions**have access to all of the variables, Table Records, and any other data available to an application.

**Array**

**Arrays**are a Tulip Datatype. Arrays are a list of other variables. Every element in an array must be the same type.

Arrays are very useful when managing multiple values that represent the same information.

*ex. The measurements of 10 quality checks can be stored in an Array of Numbers, as opposed to 10 Number variables.*

**Object**

**Objects**are a Tulip Datatype. Objects represent an arbitrary grouping of attributes. Leveraging objects can simplify the process of working with complex data architectures. Often **Connector** **Functions** will return **Arrays** of **Objects**

*ex. My car object has 5 attributes, Color, Make, Model, # of wheels, # of seats.*

**Connectors**

**Connectors** enable real-time connectivity between your Tulip solution and a transactional system (e.g. an ERP). The output of a Connector Function can be used in Tulip Apps, Automations, and Functions.

- **HTTP Connectors** utilize HTTP API endpoints.
- **SQL Connectors** can enable connectivity with certain SQL databases.
- **MQTT Connectors** can connect to MQTT brokers for machine monitoring.

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/connector.gif)

**Boolean**

**Boolean's**are a Tulip Datatype. Booleans can have True/False (Yes/No) values.

**Integer**

**Integers**are a Tulip Datatype. Integers can have any whole number.

*ex. -5, 15, 47, 155. **NOT** 15.2, -12.73*

**Number**

**Number**is a Tulip Datatype. Numbers can be any positive or negative number. Numbers support decimals.

*ex. -5, 15, 47, 155, 15.2, -12.73*

**Connector Function**

**Connector Functions** are individual operations to interact with an HTTP or SQL Datasources. Connector Functions can have inputs and outputs, and can be called from: Triggers, Functions, Automations, and AI Agents.

Once pulled, data can be used throughout your applications.

**Output**

An **output** is the transmission of data from a program to a data set.
