cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duncant
Helper V
Helper V

Filter Gallery by SharePoint List Person

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?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
mdevaney
Super User
Super User

@duncant 

Where did you put this code?  Which control & property?

 

Filter(SharePointList, Instructor.Email = User().Email)

 

Gallery Items

v-yutliu-msft
Community Support
Community Support

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@duncant 

You did not say which property of the gallery you put this code in.

Instructor field is person type  that allows multiple.

@duncant 

No.  I am asking "what property of the gallery did you put your code into"?

ilton
Resolver II
Resolver II

Hi @duncant 

You should have something like

Filter(SharepointList, email = User().Email)

instead of

Filter(SharepointList, Instructor.Email = User().Email)

 

Anonymous
Not applicable

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 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,309)