Help

ARRAYSLICE Function

Topic Labels: Formulas
1427 6
cancel
Showing results for 
Search instead for 
Did you mean: 

Saw a new ARRAYSLICE function pop up in auto-complete today that isn't in the documentation. Anyone know where it came from? I suppose it allows for a less hack-y way to access individual items in a rollup, but I'm not sure what it provides in isolation, since you would need to know the index of the item you're looking for, unless you're looking for the last item in a rollup.

6 Replies 6
Sho
11 - Venus
11 - Venus

 

Wow, a new function
I used it right away.
I would also like to have a function to get the length of an array.

<Last unique value>
ARRAYSLICE(ARRAYUNIQUE(ARRAYCOMPACT(values)), LEN(REGEX_REPLACE(ARRAYJOIN(ARRAYUNIQUE(ARRAYCOMPACT(values)),",  "),"[^,]+(,  )?","@")))

<Last value>
ARRAYSLICE(ARRAYCOMPACT(values)), LEN(REGEX_REPLACE(ARRAYJOIN(ARRAYCOMPACT(values),",  "),"[^,]+(,  )?","@")))

 

Sho
11 - Venus
11 - Venus

I see the HELP has been updated.

Array Functions in Airtable | Airtable Support

-1 value can be used, so the previous formulas were not necessary.

<Last unique value>
ARRAYSLICE(ARRAYUNIQUE(ARRAYCOMPACT(values)),-1)

<Last value>
ARRAYSLICE(ARRAYCOMPACT(values)), -1)

 I wonder if multi-select and lookups as well as link tables could be array type.

OfficeOurs
6 - Interface Innovator
6 - Interface Innovator

Comparing linked record fields is now possible. See here

Calvin_Young2
6 - Interface Innovator
6 - Interface Innovator

This was a very welcome surprise.  I just used it to drive an automation that takes a record with multiple linked records, and "splits" it into multiple records each with a single linked record. 

{Linked Record Field} gets replaced with the contents of {Linked Record Field[0]} and a new record is created where {Linked Record Field} is {Linked Record Field[1:]} from the original record.  The automation triggers recursively until the last record is created where {Linked Record Field[1:]} is empty.

I was about to do something kludgier which relied on finding commas (after first substituting them out of record names).  It's nice to *kind of* have a way to index linked records.

Still annoying that I need an trivial, intermediate formula field to turn the linked record field into an array.

jevedor
4 - Data Explorer
4 - Data Explorer

I noticed that when you use ARRAYSLICE on an array of Attachments (Images) the output is not formatted as an image, but rather a string with the name of the image and its URL.  Any way to get it to show the image?

The output of the function is always a string, so unfortunately no in the absence of a field that takes a URL and shows a preview (it's been requested since the early days of Airtable, so it's unlikely to be implemented any time soon).