I have a PowerApp with a SharePoint list as datasource. I want to do the following:
Filter the list display in Gallery based on the following test: Show the list of records for which the current user is listed as the product manager. The Product Manager field is populated from a Person/Group field in the SP List. I'm having a hard time doing this, as it seems to be a mismatch of field types. It actually works if I search on email for current user and = it to email of Product Manager, but it doesn't actually filter anything.
Thanks!
Carole
Hi @CaroleKV ,
Try this:
Filter(SPListName, User().Email in Productmanager.email) // This works only for single people picker selection
Filter(SPListName, User().Email in Concat(Productmanager,Email&",") // This works only for single people picker selection
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Proud to be a Super User!
Regards,Based on the issue that you mentioned, do you want to filter the gallery based on the user?
Combine that with your description, you want to check if the current user exists in the Product Manager column, if it does, filter the gallery based on the Person/Group column.
Thanks for @KrishnaV posting a solution. I will make some addition to this issue. As an alternative solution, you can try the formula below.
Set(CurrentUser,User().Email)
Filter(DataSource,PersonColumn.Email = CurrentUser)
Note: If this can not solve your issue, please post some screenshots about the error message.
Best Regards,
Qi
The problem I couldn't get around was that the User record type is not the same as the Person record type at all. And the person type turns the name into LastName,First instead of First Name Last Name, so it was never matching. I got around this by using the Office365User data connection, and converting the name into LastName, First so it would find a match. That solved the problem. My other problem was that this code is amongst a whole bunch of other Filter and Search code on that same gallery, so it was hard to even figure out where to put it, much less what it should be.
User | Count |
---|---|
193 | |
127 | |
88 | |
48 | |
42 |
User | Count |
---|---|
279 | |
162 | |
136 | |
81 | |
78 |