cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
inubaranaz
Frequent Visitor

How to Match Only On Existing Shared Items between two different SPO Lists

Hi all,

 

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.

 

Please help!

Thanks!

4 REPLIES 4
DamoBird365
Community Champion
Community Champion

Hi @inubaranaz 

 

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.

 

Damien

DamoBird365
Community Champion
Community Champion

Hi @inubaranaz 

 

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.
Cheers,
Damien

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")

  • 1012182236

Example List B IDs (runs multiple lookups from List A and can have a status of "Pending" or "Complete")

  • 10101212222222
    PendingCompleteCompleteCompletePendingPendingComplete

 

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.

 

Conditionally set to trigger an email when items do not match.Conditionally set to trigger an email when items do not match.Closing actionsClosing actions

DamoBird365
Community Champion
Community Champion

Hi @inubaranaz 

 

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

DamoBird365_0-1615930921781.png

YES and NO from First Condition followed by 2nd Filter Array on the original Array in each of the Apply to Each.

DamoBird365_1-1615930982570.png

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.
Cheers,
Damien

 

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (491)