Hi Community
I am having issues with getting a gallery to filter based on two SharePoint lists. My code is as follows:
SortByColumns(Filter('OCR Calendar', StatusChoice.Value = "New", User().Email = LookUp('OCR Teams', Reviewer.Email = User().Email)),"Title")
I get this error:
So I need to convert the record to a text somehow, but I cannot figure out how. The second half of the code ( from = lookup) Appears to contain the error. The field "Reviewer" Is a person field on SharePoint
If anyone can help it would be greatly appreciated
You need to get the text from a field in the record. Here is an example of getting the Reviewers Email address.
SortByColumns(Filter('OCR Calendar', StatusChoice.Value = "New", User().Email = LookUp('OCR Teams', Reviewer.Email = User().Email).Reviewer.Email),"Title")
Thank you Jeff that did the trick. Thank you for the speedy reply as well
Hi Jeff
Have recently returned to this code and turns out it wasn't doing what I needed it to actually, so currently the code is this:
SortByColumns(Filter('OCR Calendar', StatusChoice.Value = "Sent for Manager Review", User().Email = LookUp('OCR Teams', Reviewer.Email = User().Email).Reviewer.Email),"Title")
as per your suggestion. However, it isn't filtering correctly. To sum up the SP list I have it contains Team names in one column, and the Person who reviews that team in another ( Which is the Reviewer field) I need the gallery to only show the items that contain items for that Reviewers Team, but currently it just shows all items regardless of Team.
Any idea what I am missing? Thank you in advance for your help
Hi @Pxtavern ,
The second part of your lookup is doing nothing
User().Email =
LookUp(
'OCR Teams',
Reviewer.Email = User().Email
).Reviewer.Email
as it is not filtering any field in 'OCR Calendar'. What fields do you have in 'OCR Calendar' and 'OCR Teams' to link the Lists?
Hi @Pxtavern ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi Warren, Thank you the solution you gave on: https://powerusers.microsoft.com/t5/Building-Power-Apps/Filter-one-Gallery-based-on-two-SharePoint-L... was what I needed Thank you 🙂
User | Count |
---|---|
152 | |
93 | |
84 | |
77 | |
58 |
User | Count |
---|---|
194 | |
174 | |
106 | |
96 | |
89 |