
Announcements
Hi everybody,
I'm looking for a way to compare two arrays and find missing items.
In my case, Array #1 contains a list of people who need to complete a task:
Hi @BenWishh
Here is the sample flow.
I have stored both the input arrays in compose actions:
[
{
"DisplayName": "Person A"
},
{
"DisplayName": "Person B"
},
{
"DisplayName": "Person C"
},
{
"DisplayName": "Person D"
}
]
[
{
"DisplayName": "Person A"
},
{
"DisplayName": "Person D"
}
]
Next, add "Select" action to create plain array of values present in compose 2 action:
click "Switch map to text mode" and enter the below expression:
item()?['DisplayName']
click "Edit in advanced mode" and enter the below query:
@not(contains(body('Select'), item()?['DisplayName']))
The output of filter array will give the desried result.
Output:
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.