Searching Gmail, but removing duplicates

:bullseye: What is your goal?

I am trying to automate Unsubscribes in my Gmail. I have a scenario that starts by searching for emails that are unsubscribes from the last week, which then modifies their contact. The problem is, often times people will click unsubscribe multiple times (no idea why), which means there are multiple bundles with the same email address. How can I make sure I am not passing the same email address throughout my entire scenario multiple times?

:thinking: What is the problem & what have you tried?

I don’t even know where to begin on this one. I am guessing there is a module that I can use for this, but being new to Make, I don’t know what that would be.

1 Like

Hi @AAC_Northern_Sierra

You probably have an array of email addresses, right?

Have you tried using the deduplicate(array) or distinct(array; [key]) functions? The choice between them will depend on wether you have an array of strings (addresses) or a complex object for each email.

We would need to see your scenario to provide better feedback.

@damato

I don’t have an array, but maybe that’s a direction to go. Here is a link to my shared scenario (sorry if that’s not the best way to show you my scenario, I’m new here) Gmail Unsubscribe - Make.com Automation Scenario

Basically, I use the Search Emails module, which returns bundles of emails that meet the search parameters instead of a single array.

1 Like

You can export the blueprint and/or add screenshots. I believe it’s the best way to share your issue.

Sharing the scenario publicly may lead to someone messing up with your work.

Then it’s even easier. Just aggregate the results and group by the sender’s address:

Make sure to check all the necessary fields.

You’ll get a bundle for each distinct sender address. Just iterate that bundle and use the Key.

@damato

3 Likes

Brilliant! That is exactly what I needed. Thanks!

3 Likes