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.
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.
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.
In the Data Editor, open the table you want to edit.
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.
Name the column.
For Type, search for Make Array or navigate to Computed -> Make Array.
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.
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.
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.
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.
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.
In the Data Editor, add a Make Array column to your table.
Select the columns from your data source that you'd like to include in the array.
Add a Joined List column and select your Make Array column as the source.
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.
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.