Deduplicate contacts inside different bundles

Hi guys!

I need help for this scenario that I created:

What it do?

Takes all the emails inside the array “emails” from the collection “contactDetails” and insert a row in a Google sheet.

What is the problem?

The problem is that I have multiple bundles results that can have inside the array “emails” the same email of another bundle.

For example, in bundle 1 I have inside the array “emails” this two email:


In bundle 23 I have:


What I would like to achieve?

I would like to have unique email address for all bundles, deduplicating the results and insert inside a Google Sheet


Thank you for any help you can give me :pray:t2:

The bundles should be aggregated into an array. Then the array can be deduplicated with a function in
However, this would simply result in a list of unique emails. All the information around it would be lost.


Hi @Levin,

Thanks for your reply!

But I’m in the stack now.

I have aggregated contactDetails. But this is the result: array with multiple collections. How can I create the array with all the emails and then deduplicate?

With the map function, but it can be difficult to use.
If the number of operations is not so important, you can first save each contact bundle in a variable. In the variable, you can select only the email array and then aggregate this variable