Make Array Column

Combine columns in your data source to create an array.

The Make Array column cannot be assigned as a Row Owner in your app. If you'd like to assign an array as a Row Owner, the array must be created in a Google Sheet data source.

The Make Array column allows you to join different values from multiple columns into an array, regardless of their column names. Array columns combine the data from multiple columns into a single column in the Data Editor.

About Array Columns

If you're familiar with arrays in Glide, you'll know that Glide will automatically create an array if the columns in your Google Sheet are named sequentially. This is useful for columns with similar data, like creating an image carousel out of multiple images.

An array of images in a column.

There may be times when you need to create an array that is based on columns that contain different information or when column names aren't identical. This is where the Make Array column can provide more functionality in your app.

Creating a Make Array Column

  1. In the Data Editor, open the table you want to edit.

  2. Add a new column by clicking the plus (+) symbol to the right of the table.

    • New columns added with the plus button will always appear on the right. If you'd like to add a column somewhere else in your data, you can select the dropdown menu on an existing column and choose Add column right. You can also click and drag columns to rearrange them.

  3. Name the column.

  4. For Type, search for Make Array or navigate to Computed -> Make Array.

  5. Under Items, enter a custom value, or select a column from your data source to use as the first item of your array.

  6. Continue to add items to build out your array as needed. You can select columns of different types for your array. The order of the items in the Make Array column cannot be changed after they are entered. Once you've entered all the items, click Done.

Using the Make Array Column

If your data source has multiple image columns, you can use the Make Array column to combine them into a single array column that can be used to display an image carousel in your app. This is especially useful if you're using a data source other than Google Sheets or if your image columns are not named similarly and sequentially.

Image carousel using an array column.

Combine multiple arrays to form a new array

Your data source may contain multiple arrays. For example, you may have an array of exterior photos of a property and an array of interior photos of a property. Using the Make Array column, you can combine these arrays to create an image carousel that displays all the photos for each property.

Combining multiple array columns.

Add an item to an array

If you need to include an additional column value as part of an existing array, you can add it as an item in your array. Although you cannot rearrange existing items in a Make Array column, you can add a new item before the first array to display it at the start or after the last to show it at the end.

Adding an item at the start of an array.

Create a list of items that ignores empty columns

The Make Array column only includes non-empty data from the columns you assign as items in your array. Because of this, you can create a nicely formatted comma-separated list that automatically ignores any cells without a value.

You can also combine columns of data using a Template column. However, the Template column does not ignore empty data like the Make Array column. Any cells without a value may be pulled into a comma-separated list as punctuation or gaps.

Creating a comma separated list

  1. In the Data Editor, add a Make Array column to your table.

  2. Select the columns from your data source that you'd like to include in the array.

  3. Add a Joined List column and select your Make Array column as the source.

Adding a Joined List column to create a comma-separated list.

Perform various math functions

Suppose your data source contains multiple columns of numbered values. In that case, you can use the Make Array column to group the data and then perform a variety of math functions. This is especially useful if some of your columns are empty.

If a numbers column is empty, the Math column will interpret it as a zero value. This may cause some math functions to give incorrect results if your empty columns are intended to be excluded from the calculations. In this case, using a Make Array column would give you more accurate results.

For example, you may have a data source that contains scores for various tests. Some tests may be completed while some are not yet completed. A Math column that calculates the average scores of all tests would not be accurate for each row, as it would assume zero values for each of the empty cells. Use the Make Array column to exclude empty columns from your calculation, then use a Rollup column to calculate the average.

Using a Rollup column to calculate the average of the numbered items in an array.

You can use a Rollup column to perform other functions, such as determining the minimum and maximum test scores or displaying a count of how many tests were submitted.

Creating Array Columns when using Google Sheets

Have a question about Make Array Column? Ask the Glide community.

Updated more than a week ago
Was this article helpful?