I have created a Gallery, from a SharePoint List, that will list all courses associated to the currrent user sign in using Office365 Users Connection. I have setup a input box to allow users to search the users DiplayName, Email, or Department. I attempt to use the following formula:
Filter(SharePointList, Instructor.Email = User().Email)
It does not seem to be working. I am running into the following error:
Invalid argument Type. Cannot user table values in this context.
What is the proper way of comparing a user from a list to the current user?
Solved! Go to Solution.
Hi @duncant ,
Do you want to filter items based on current user?
Could you tell me
1)the data type of Instructor field?
2)whether Instructor field allow multiple person?
If Instructor field is a person field and allows multiple person, you could set the gallery's Items:
Filter(SharePointList, User().Email in Instructor.Email)
Because if Instructor field allow multiple person, then "Instructor.Email" represents a table, not a value. You need to use "in"
to compare.
Best regards,
Where did you put this code? Which control & property?
Filter(SharePointList, Instructor.Email = User().Email)
Gallery Items
Hi @duncant ,
Do you want to filter items based on current user?
Could you tell me
1)the data type of Instructor field?
2)whether Instructor field allow multiple person?
If Instructor field is a person field and allows multiple person, you could set the gallery's Items:
Filter(SharePointList, User().Email in Instructor.Email)
Because if Instructor field allow multiple person, then "Instructor.Email" represents a table, not a value. You need to use "in"
to compare.
Best regards,
Instructor field is person type that allows multiple.
No. I am asking "what property of the gallery did you put your code into"?
Hi @duncant
You should have something like
Filter(SharepointList, email = User().Email)
instead of
Filter(SharepointList, Instructor.Email = User().Email)
Hi @duncant ,
Have set up a Sharepoint list with a multiple person selection column and tested, seems to be working with the following in the Items property of the gallery:
Filter(SharepointList, User().Email in Instructor.Email)
Hope this helps 🙂
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
264 | |
91 | |
78 | |
68 | |
67 |