cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amyharkus86
Resolver I
Resolver I

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
Helper II
Helper II

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
Jeff_Thorpe
Super User
Super User

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.

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

 

 

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.

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
Helper II
Helper II

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (36,672)