cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
amyharkus86
Level: Powered On

Filter by current user Gallery

I have built an app with SharePoint fields, there is not a user field in the sharepoint list 

I want to be able to filter the gallery view to only show ones submitted by the current user 

 

At the moment there is a FilterTextBox and in the items for galary a filter

Filter('Vehicle Check', FilterTextBox.Text in Title)

allowing the user to seach for their submissions, but i want it to only display their ones and can't seem to get it to work 

 

I've tried a couple of things in the Items gallary 

Filter('Vehicle Check,email = UserEmail) this returns nothing am not sure what i am missing

 

I've also tried this provided in another post 

 

1) On the "OnStart" property of you app, place this expression:
Set(UserEmail, User().Email)
 
2) Now Items need to be modified as:
Filter(DataSourceName,email = UserEmail) 
 
above comes up blank 

 

1 ACCEPTED SOLUTION

Accepted Solutions
yanni99
Level: Powered On

Re: Filter by current user Gallery

Shane Young did a video about this not so long ago. Maybe it will answer your questions.

(Sorry I cannot seem to be able to tag him).

 

 https://www.youtube.com/watch?v=-VaADTTPYmg&list=PLCGGtLsUjhm2bonhBZuEhZU72QkFjOpc6&index=67&t=0s

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Filter by current user Gallery

If you are still setting UserEmail then the filter would look like this:

 

Filter('Vehicle Check', 'Created By'.Email = UserEmail) 

 

This will return all the item the current logged in user created in 'Vehicle Check'. People columns in SharePoint aren't delegable, so you will get a warning but if your list is small it won't make a difference. 

 

By default the data row limit for non-delegable queries is 500 but you can increase that to 2,000 by going into File > App Settings > Advance Settings



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
amyharkus86
Level: Powered On

Re: Filter by current user Gallery

Thank you for your reply.

I'm sure its just me for some reason can not get my head around this one!

 

I've changed the filter for Items on the gallery

Filter('Vehicle Check', 'Created By'.Email = UserEmail)  and on the App OnStart Set(UserEmail, User().Email)

 No luck Smiley Sad

Looks to accept the fields populate no data (attached)

 

Possibly helpfull to provided the fields in my data for the gallary

 

Body5 ThisItem.'Last Name'

Subtitle5.'First Name'

Title6 ThisItem.'Created By'.Email

 

My SharePoint list is called Vehicle Check and has about 20 fields, incuding 'Created By'

 

I've not connected it to O365 User but can do if this is a possible solution

 

 

Super User
Super User

Re: Filter by current user Gallery

The formula looks correct and blue squiggly line is because of delegation. How large is your list and have you verified that the variable UserEmail has the correct value? You can go to View > Variables in toolbar and see what the current value of the variable is to.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
amyharkus86
Level: Powered On

Re: Filter by current user Gallery

My SharePoint list is quite small at the moment about 15 inputs, all for tests really as the app is not yet live.

 

My UserEmail value is set to No Value

 

First app i've used this sorta of things so a little over my head at the moment.

 

The app has a dataconnection to Office365 Users

 

 

 

yanni99
Level: Powered On

Re: Filter by current user Gallery

Shane Young did a video about this not so long ago. Maybe it will answer your questions.

(Sorry I cannot seem to be able to tag him).

 

 https://www.youtube.com/watch?v=-VaADTTPYmg&list=PLCGGtLsUjhm2bonhBZuEhZU72QkFjOpc6&index=67&t=0s

View solution in original post

amyharkus86
Level: Powered On

Re: Filter by current user Gallery

Thank you, I followed the video and created an additional fieled in my sharepoint list

 

Onstart up i now have

set(varUser, User())

 

on Galleary Item i have

Filter('Vehicle Check', CreatorEmail = varUser.Email)

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,594)