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 Platform Community / Forums / Power Apps / Filter Gallery for Man...
Power Apps
Unanswered

Filter Gallery for Manager and Manager's Subordinate's Data

(0) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2

I am trying to filter a Gallery. For a 'Manager' they should be able to see all of their own requests AND the requests of their subordinates.

The below gets me the 'Manager' data, by date, in descending order. What do I add to the code to include the request of the manager's subordinates?

If(JobTitle.Text = "Manager",
   SortbyColumns(Filter('SPList1',
        (Status.Value="Content1" && 'Created By'.DisplayName = User().FullName ||
        (Status.Value="Content2" && 'Created By'.DisplayName = User().FullName ||
        (Status.Value="Content3" && 'Created By'.DisplayName = User().FullName)), "Date",SortOrder.Descending),

   SortByColums('SPList1',"Date",SortOrder.Descending))

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @Phineas ,
    Please try updating Filter part of the formula using below -

    Filter('SPList1',
            (Status.Value="Content1" && 'Created By'.Email= User().Email) ||
            (Status.Value="Content2" && 'Created By'.Email= User().Email) ||
            (Status.Value="Content3" && 'Created By'.Email= User().Email) ||

    Lower('Created By'.Email) in Lower(Office365Users.DirectReportsV2(User().Email).value.mail) ) 

     

     

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I've got another version that incorporates a radio control and combobox, for filtering the Gallery. I need the same resolution; If user is a 'Manager' they should see all their requests and those of their subordinates. Everyone else should see the entire list, by Date 'Descending'.
     
    Here is the current code - 

    If("Contractor" in JobTitle.Text,
        Switch(CategoryRadioCntrl.Selected.Value,
      "Status",
         SortbyColumns(Filter('SPList1',Status.Value =
         SearchComboBox.Selected.Value),"Date",Descending),
      "Created By",
         SortbyColumns(Filter('SPList1','Created By'.DisplayName.Value =
         SearchComboBox.Selected.Value),"Date",Descending),
      "Meeting Subject",
         SortbyColumns(Filter('SPList1','Meeting Subject'.Value =
         SearchComboBox.Selected.Value),"Date",Descending),

    If("Manager" in JobTitle.Text,
        Switch(CategoryRadioCntrl.Selected.Value,
      "Status",
         SortbyColumns(Filter('SPList1',Status.Value =
         SearchComboBox.Selected.Value),"Date",Descending),
      "Created By",
         SortbyColumns(Filter('SPList1','Created By'.DisplayName.Value =
         SearchComboBox.Selected.Value),"Date",Descending),
      "Meeting Subject",
         SortbyColumns(Filter('SPList1','Meeting Subject'.Value =
         SearchComboBox.Selected.Value),"Date",Descending),

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard