Deduplication Logic Using map() and contains() in Make.com (Cleaned Arrays)

Hi everyone,

I’m working on a Make.com scenario where I’m trying to deduplicate scraped leads against existing Google Sheets leads.

Here’s my current setup:

I have two clean primitive arrays already:

  • CleanPrimitiveSheetEmails — extracted from Google Sheets (1047.Array), mapped “Email (E)”, cleaned with remove(emptystring, null).
  • CleanScrapedEmailsExtracted — extracted from scraped leads (1044.Array), mapped email, also cleaned with remove(emptystring, null).

Both variables contain clean string arrays of emails like:

and

:white_check_mark: Goal :

Keep only the scraped leads whose emails do not already exist in the sheet list.

:white_check_mark: **What I’m trying to do ** :

I attempt to map() over 1044.Array like this:

map(
1044.Array;
if(
contains(
CleanPrimitiveSheetEmails;
email
);
emptyarray;
this
)
)

Then remove(emptyarray) after that.


Problem :

When I run this, all results come back empty inside the mapped output —

instead of getting just the fresh leads.


Important notes:

  • Mapping email works properly separately.
  • Primitive sheet emails are clean.
  • contains() manual tests (e.g., contains(CleanPrimitiveSheetEmails; “”)) return expected results.
  • No errors, just wrong output which should just be all of the items in array 1044

My suspicion :

Possibly this.email context inside the map is wrong, or maybe there’s some misbehavior in how the field is referenced during conditional mapping.

(I’m confused because sometimes in Make.com you reference fields raw vs using this. depending on context.)


Question:

:white_check_mark: How should the if(contains()) logic be properly structured inside a map() here?

:white_check_mark: Should I reference this.email, just email, or wrap with something else like get()?

:white_check_mark: Am I missing a subtle context switch inside map()?


Would love any guidance, sample code, or debugging advice —

happy to share screenshots of my scenario if needed too.

Thanks in advance for any help!

Welcome to the Make community!

Please provide the following, especially uploads of your Output bundles.

You have not yet provided sufficient information to demonstrate the problem that would allow us to reproduce the scenario and any error(s).

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Could you please share screenshots of your full scenario? Also include screenshots of any error messages, module settings (fields), relevant filter settings (conditions), and module output bundles. We need to see what you’re working with to give you the best advice.

You can upload images here using the Upload icon in the text editor:

We would appreciate it if you could upload screenshots here instead of linking to them outside of the forum. This allows us to zoom in on the image when clicked, and prevent tracking cookies from third-party websites.

2. Scenario Blueprint

Please export the scenario blueprint. Providing your scenario blueprint file will allow others to quickly recreate and see how you have set up the mappings in each module, and also allows us take screenshots or provide module exports of any solutions we have for you in return - this would greatly benefit you in implementing our suggestions as you can simply paste module exports back into your scenario editor!

To export your scenario blueprint, click the three dots at the bottom of the editor then choose ‘Export Blueprint’.

You can upload the file here by clicking on this button:

3. Output Bundles of Modules

Please provide the output bundles of each of the relevant modules by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved, and help you with mapping the raw property names from collections.

Sharing these details will make it easier for others to assist you.

blueprint.json
blueprint.json (19.4 KB)

Output Bundles of Modules of CleanScrapedEmails

bundle.txt (3.0 KB)

Output Bundles of Modules of DeDupedLeadsArray

bundle.txt (1.8 KB)

let me know if you need anymore context

Screentshot of Scenario

Ouptut bundle of clean primitive sheets email
[
{
“deDupedExistingEmails”: [
natalia@aranovichlawfirm.com”,
andrew@goldwasserchan.com
]
}
]

Hey Javi,

just to clarify → you have 2 arrays of emails and you want to clean the second array and leave only values that don’t exist in the first array right?

Iterate the second array, put a filter after that uses the contains(1st.array;value) and set to Boolean equal to false, then aggregate it back in an array.