I am using a base to track orders. I have 3 tables: Orders, Orderlines, and Assets.
The Orderlines table has an Assets column that links to the Assets table, with the option to allow linking to multiple records. The Orders table has a rollup column Assets that refers to the Assets column in the orderlines table, and applies the
Given these rows in the Orderlines table, the corresponding row in the Orders table does NOT display unique assets:
- Asset A; iPhone 8; USD 400
- Asset B; iPhone Case; USD 30
- Asset A, Asset B; Shipping; USD 12
The rollup column Assets in the Orders table has this value:
Asset A, Asset B, Asset A, Asset B
ARRAYJOIN(ARRAYUNIQUE(values)) illustrates the problem:
Asset A; Asset B; Asset A, Asset B
Notice that there THREE values that Airtable considers unique:
- Asset A
- Asset B
- Asset A, Asset B
I thought that applying
ARRAYFLATTEN(value) first would solve the problem:
Unfortunately this does not seem to make any difference.
I hoped I could work around the problem by combining the 3 items into a string with
ARRAYJOIN(values, ", ") and then splitting the resulting string back into an array of 4 items (splitting on
", ") that I can then apply
ARRAYUNIQUE() to, but there doesn’t seem to be a function to split a string into an array.
I need the Assets column in the Orders table to contain this array:
Is that possible?