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

Filter gallery by current user

HI!
I want the gallery in the app to only show the informartion typed in by the current user. 

Can i use this on the item property on the gallery? Filter('Timeregistrering'; User().Email = User().Email))

Thanks

3 REPLIES 3
Super User
Super User

Re: Filter gallery by current user

Can you explain a little better what you are trying to do? I am sure we can accomplish it I just don't want to steer you wrong because I am not exactly sure what you want.

 

Does the gallery already contain a field with the user's email address that we can filter against?

Did they just enter this info or could they have done it at any point?

 

Shane

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Tomjoh92
Level: Powered On

Re: Filter gallery by current user

I'm trying to make an app where employees can register their work hours. They check in and out and provide some information. This goes back to my excel sheet and make a paycheck. 

I want the employees to only see their own data, not all the others. 

I've made a text box in the check in label with User().Email and that provides correct email without me typing it anywhere so i'm guessing it finds automatically when you sign up on powerapps on the phone. 

When i tried to type function i suggested i didnt get any error messages, but its a bit hard to try it when i dont have acces to an another e-mail yet.

Super User
Super User

Re: Filter gallery by current user

Hi @Tomjoh92

 

You will need to have a column in the excel sheet like "UserEmail" , where you will have to collect the User().Email, so every record that is created can be mapped to the user.

 

Now when filtering you can use Filter('TimeRegistering',UserEmail=User().Email)

 

To test it out, you can create some dummy records in the excel sheet some random email ids defined in the UserEmail column. This way, when you check in , you can see if all your records are shown or not.

 

Hope this helps.!


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,829)