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

Filter by status and by current user

Hi,

 

I'm new to PowerApps. Need some help with the formula below I would like to know how I can filter from a SharePoint list by Status column and by current user within a gallery. 

I only want the user to view their own items submitted and their item status.

 

Currently i have for each gallery to filter by status: 

 

Filter(Leaves, Status = "Approved") 

Filter(Leaves, Status = "Rejected")

Filter(Leaves, Status = "Pending")

 

Not sure if the above is correct but also how do i add another filter by current user? 

 

Can someone help please? I'm trying to use PowerApps to build a basic Leave application app.

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Filter by status and by current user

Hi,

as its described on some pages there is a syntax for current users.

 

User().FullName="Name Surname" / user().Email="email@domain.xxx /

 

 

For sharepoint list viewed by gallery I use setting in data -> "items" setting this formula

 

SortByColumns(Filter('list',Author.DisplayName=User().FullName),"{Identifier}") - which will show only items created by me.

 

Remember that if you are using columns on sharepoint with "person or group" you will have to define attributes which are different from user(). 

 

For logical connections of the functions use propriete separator 

 

Cheers

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Re: Filter by status and by current user

Hi,

as its described on some pages there is a syntax for current users.

 

User().FullName="Name Surname" / user().Email="email@domain.xxx /

 

 

For sharepoint list viewed by gallery I use setting in data -> "items" setting this formula

 

SortByColumns(Filter('list',Author.DisplayName=User().FullName),"{Identifier}") - which will show only items created by me.

 

Remember that if you are using columns on sharepoint with "person or group" you will have to define attributes which are different from user(). 

 

For logical connections of the functions use propriete separator 

 

Cheers

View solution in original post

Meneghino
Level 10

Re: Filter by status and by current user

Just to add to @Anonymous's reply, please see here to ensure you have no issues with User()

https://baizini-it.com/blog/index.php/2017/08/29/powerapps-user-function-cache-current-user-onstart/

Highlighted
Jimmy_Jazz
Level: Power Up

Re: Filter by status and by current user

Thank you,

 

I've been searching all day for this. Everything else I looked at was completely wrong.Either PowerApps syntax is constanly changing or all the other postings are garbage. Thanks so much.

DavidGarcia1
Level: Powered On

Re: Filter by status and by current user

How would the code be if I have "person or group" columns?, i have a problem, this code works with me, but not with other users, they do not appear the records that they do, but I do not see theirs but if mine

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 359 members 4,307 guests
Please welcome our newest community members: