Iterating an array against the contents of another array

I’m a newbie. I’m trying to compare an array of values with another array of values. I understand that we cannot use the built-in functions for this. I understand I have to Iterate one of the arrays (module 21).

The last module in the attached blueprint is testing for success. If the scenario worked, then the email label SE would be found contained in the array of labels for which I’m testing and the variable would be set to true.

What am I doing wrong?

blueprint.json (13.4 KB)

Hi Jay. I’ve created a quick example of how you can do this.

Here’s my sample output for the two arrays I have:

You want to iterate the first array and place the filter just after the iterator, like so:

And this is how your filter should look like:

In my example, only the values that match in both arrays move on to the next step which is in this case “customer” and “shopkeeper”.
Hope that helps.

2 Likes

@Shornalatha, I really appreciate your help.

I’ve tried your solution and I’m hitting a snag. It appears that Aggregator 3 is making an array of collections in which the value for which I want to test is burried.

Is there any way I can make aggregator 3 give me an array if value and not collections with values?

Thank you!!

blueprint.json (29.9 KB)

Hi Jay,

Try use this in the filter

Thanks, @D-EFFCON and @Shornalatha. That worked! However, I needed to replace A with the 0.

1 Like