Array subtraction

I see noone has answered your question in over 1 month. How sad. I’ll give it a try now. If I understand your question you wish to create a scenario which effectively returns items in array1 that are only in array1 and not in both array1 and array2.

We will start with a simple case of a simple array. Evolving this to an array of collections would be more complex because you will need logic to identify whether you want to match by key, by value or by a combination of both (most likely this one).

array1 = [a,b,c,d]
array2 = [b,c]

Your desired result is [a,d]. I hope that is correct.

This 4 operation scenario snippet will do what you want. You can expand on this to support more complex arrays. I’ve tested it with strings and numbers.

Here’s the
arraysubtraction.json (6.9 KB)
for you to mess around with. If Make.com had a filter() function this could be done in 1 operation.

2 Likes