web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Filtering By User

(0) ShareShare
ReportReport
Posted on by 4

I have the filter below on a gallery, and would like to add an additional filter to filter by user but don't know where to add it. The goal is to only allow users to view their own request.

SortByColumns(Filter([@ClientReassignmentRequest],If(StatusFilter.Selected.Value="All",true,Status.Value=StatusFilter.Selected.Value), StartsWith(Summary, TextSearchBox1.Text)), "Created", If(SortDescending1, Descending, Ascending))

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Do you have some sort of Username column in your table you can use in the Filter against the currently logged-in user? If so, you could insert the code where indicated:

    SortByColumns(
     Filter([@ClientReassignmentRequest], 
     If(StatusFilter.Selected.Value="All", 
     true, 
     Status.Value=StatusFilter.Selected.Value
     ), 
     StartsWith(Summary, TextSearchBox1.Text)
     , // Insert your user filter term here e.g. UserName = User().FullName
     ), 
     "Created", 
     If(SortDescending1, Descending, Ascending)
    )

    Hope that helps,

    Bryan

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @UrquidiAlex,

    Based on the issue that you mentioned, do you want to filter the gallery based on the current user?

    Could you please share a bit more about your scenario?

     

    Actually, if you sue the User() function to define the current login user, please refer to the Email parameter.

    Modify your formula as below:

    SortByColumns(Filter([@ClientReassignmentRequest],
     If(StatusFilter.Selected.Value="All",true,Status.Value=StatusFilter.Selected.Value), 
     StartsWith(Summary, TextSearchBox1.Text),
     User().Emai=RequestedBy.Email), // Here I assume that you have a Person column to store the user info who requested.
    "Created", 
    If(SortDescending1, Descending, Ascending)
    )

    Or, if you use the auto-generated column CreatedBy column to save the requester, I think you could just modify as below:

    SortByColumns(Filter([@ClientReassignmentRequest],
     If(StatusFilter.Selected.Value="All",true,Status.Value=StatusFilter.Selected.Value), 
     StartsWith(Summary, TextSearchBox1.Text),
     User().Emai='Created By'.Email), // Here I assume that you have 'Created By' column to store the user info who requested.
    "Created", 
    If(SortDescending1, Descending, Ascending)
    )​

     

    Hope it could help you at some degree.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard