I have two collections containing SharePoint list data. I want to show items in a gallery from Collection A that do NOT exist in Collection B, and I want to do this by comparing emails from a SharePoint Person column.
Here's the example:
Collection A:
Person |
Table |
Table |
Collection B:
Date | Person |
7/2/2020 | Table |
7/2/2020 | Table |
Since the "tables" are from SharePoint, this is a sample of what they contain:
DisplayName | |
Joe Smith | jsmith@email.com |
I figured I'd do something like this in the Gallery's Items property, but this obviously doesn't work:
Filter(CollectionB,Not(CollectionB.Person.Email in CollectionA.Person.Email))
Solved! Go to Solution.
Hi @pwrappr01 :
Please check the following two situations:
Case1:If the person fileds in collectionA and collectionB are all table type,Please try this code:
Filter(CollectionB,!(First(Person).Email in Ungroup(CollectionA,"Person").Email))
Case2:If the person fileds in collectionA is table type but the person fileds in collectionB is record type ,Please try this code:
Filter(CollectionB,!(Person.Email in Ungroup(CollectionA,"Person").Email))
Best Regards,
Bof
@pwrappr01
Your formula is very close to the solution. Here's how I would write it 🙂
Filter(CollectionA, !(Person.Email in CollectionB.Person.Email))
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@mdevaney, thanks for the response. I tried this, but the CollectionB.Person.Email throws an error ("Name isn't recognized") when used in conjunction with the in operator for some reason. It works everywhere else in the app when invoked.
Hi @pwrappr01 :
Please check the following two situations:
Case1:If the person fileds in collectionA and collectionB are all table type,Please try this code:
Filter(CollectionB,!(First(Person).Email in Ungroup(CollectionA,"Person").Email))
Case2:If the person fileds in collectionA is table type but the person fileds in collectionB is record type ,Please try this code:
Filter(CollectionB,!(Person.Email in Ungroup(CollectionA,"Person").Email))
Best Regards,
Bof
@v-bofeng-msft, Case #2 worked like a charm. Thank you much, and thank you, @mdevaney, for posting to assist.
User | Count |
---|---|
184 | |
123 | |
91 | |
47 | |
42 |
User | Count |
---|---|
271 | |
159 | |
132 | |
85 | |
78 |