Mapping multidimensional array

I am having trouble getting the value I need from a Google Maps app. I am trying to extract the Short Name for State, that is an array of collections. I cannot simply use a static index, since the State collection index will vary in the results depending on the lookup. Here is a screen shot of the Google Maps array result:

Based on this, I need to get the Short Name value for a collection that has a type set to “administrative_area_level_1”. So in this case, since collection 4 contains a Type with a value of “administrative_area_level_1”, I need to get the Short Name value which is TX.

I have the following map, but it returns the Short Name for each collection instead of the specific one:
{{map(1.address_components; “short_name”; types[1].value; “administrative_area_level_1”)}}


Hello @Max_TBB You can use an array aggregator for this

@PathfinderAutomate How so? I did experiment with the Array aggregator for this but couldn’t figure out how to solve this.

1 Like

Hey @Max_TBB

Please use the map() function like below:

{{map(1.address_components; “short_name”; types.1; “administrative_area_level_1”)}}

Please Note: types[1].value is changed to types.1

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation

1 Like

@Msquare_Automation Thanks so much, that worked!

1 Like

Glad to help you. @Max_TBB :tada:

Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation