Would appreciate any insight on filtering out items that do not exist in a list. What I am doing is comparing IDs from List A to List B IDs. I have successfully done this using the Boolean and the end trigger is an email. However the emails are being sent out even if IDs do not exist in List B, which I do not want. It should only be sending out items if the below statement is met:
What we is needed = IDs from List A match List B and those same IDs in List A actually exist in List B.
I think you are looking for the function intersection(). If you stick it into a compose action with intersection(listA,listB) the output should be those that exist in both. Alternatively, union() if you want those that exist in either but I don't think that is what you are asking for.
How are you getting on? If you need more help then please let me know.
If my post has helped, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DamoBird365 ,
Can the intersection() function work for SharePoint lists that have a 1:M relationship? In the case of my team - we are comparing List A IDs to List B IDs.
Example List A IDs (all unique & in the status of "Awaiting Review")
Example List B IDs (runs multiple lookups from List A and can have a status of "Pending" or "Complete")
The scenarios we want to achieve if following the above example:
- Email should send for item ID#12 as all items in List B set are complete.
- Email should NOT trigger if any items in List B set are marked pending (all complete or none). Item ID #10 or #22 should NOT trigger the email.
- Email should NOT trigger for any items in that do not exist in List B. Item ID #18 and #36 should NOT trigger the email.
Pictured is our current working solution. It triggers an email based on NOT matching IDs with items that are in a status of 'Pending'. However, we are having issues with the last scenario, we find that the email is still delivered for items that exist in List A but not in LIST B. This is what we want to avoid. Would appreciate your thoughts.
I hope this meets your expectations... ignore the earlier comment about the expressions as I now understand what you are looking for - I hope!
I've used filter array twice and condition twice. The first filter is on the 2nd get items where id's match in an apply to each. I.e. get all items from list b that match id in list a. If its length is greater than 0 (Yes) we know we have some pendings or completes, otherwise it's a No and it hasn't started.
In the Yes I filter again, this time on the filter from above where the status is not equal to complete. Again we check the length greater that 0 (yes) meaning we have some pendings and is still underway, No meaning we have a completed task.
Hopefully that makes sense and matches with your expectations?
What does it look like?? Quite big but hopefully quite tight.
First Apply to Each with Filter and Condition
YES and NO from First Condition followed by 2nd Filter Array on the original Array in each of the Apply to Each.
Hopefully you can see this OK?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks