How to solve array of collections when getting insights from Meta Ads

I’m trying to get data (unique actions) from Facebook Ads (Insights) and it is returning an array of collections.

image

Each item of the array have a collection, and the collection have 2 keys:

action_type
value

I wanna loop over all items of the array and find a specific action_type.

How can I do this?

Hi @MEDYA_Solucoes_Digit,

You can use iterator module to do so, but the easier one will be to use map function.

map(Unique actions;value;action_type;lead)

This will result in an array with all item values that you have with acttion_type=lead. You can then use get or first function to get the value.

first(map(Unique actions;value;action_type;lead))

1 Like

Perfect.

It was running on the last days and everything is correct!

Thank you!