I’m trying to extract particular values from an array based on the key. This would be fine if they all shared the same key name and/or I knew exactly how many there would be of them. But I don’t.
Please see attached screenshot of the array I’m trying to work with.
I want to only work with the key values of Photos0, Photos1, Photos2 etc (which could go up to 25). How do I write a formula that minifies the array to only those items?
Appreciate your help.
Welcome to this community.
In order to create a new array with only the key as values, you can use the
(Change the array to your array variable.)
Hey! Thanks so much for getting back to me!
The problem is that the key is not always the same. A number is always appended to the key from 0 upwards (depending on how many items there are). So It goes photos0, photos1, photos2 etc…
So my question is how do I target the key (photos) but ignore those annoying numbers on the end?
I was thinking it can be done with one of the other functions available, or even a regex perhaps?
Hi @Ally_Colquhoun ,
In this case, you could use a combination of an
array iterator and
array aggregator. Where you then apply a filter in between.
I created a small demo…
Glenn - Callinetic
That’s the secret sauce I was looking for, thank you so much for taking the time!!