Check array for duplicates and send e-mail depending on the result

Hi everyone,

I’m new to Make and still have a lot of question marks in my eyes :slight_smile:

I am currently trying to create a process that searches for orders in two different statuses in PlentyMarkets, pulls the customer number from them and checks whether a customer number occurs more than once.

I have now reached the point where the array aggregator tool outputs an array of all customer numbers that belong to orders in these statuses. But now I don’t understand how I can check the output from the module for duplicate customer numbers.

This is the Output of my array aggregator:

In the next step, if one or more duplicate customer numbers are found, an e-mail with the customer numbers that occurs more than once should be sent. If no duplicate customer numbers are found, an e-mail should simply be sent stating that there are currently no duplicates.

Can anyone help me here? That would be great.

Many thanks in advance.

You can use the deduplicate() function around the array to remove all the duplicates.

Hi, thank you very much for your answer.

But I don’t want to remove duplicates, I want to check if there are duplicates and if so, send these duplicate customer numbers by mail.

Or have I misunderstood your answer?

Best regards

Hey Sebastian,

you can compare the two arrays and see if they are different lengths - if the original array is longer than the deduplicated one, then there were duplicates.

1 Like