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

Announcements

News and Announcements icon
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
    Microsoft Employee 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard