cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Raeville
Helper I
Helper I

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

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

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
Community Champion
Community Champion

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/

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.

Anonymous
Not applicable

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,080)