cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
holtma
Frequent Visitor

Admin overview on filtered gallery

Hi Everyone, I am having some trouble with creating an "admin view" of a gallery where the filter does not apply for certain admin users. Here is the filter which means that in this gallery, users can see only projects on which they are the Project Lead (this filter is working without any issues):

 

SortByColumns(Filter(ProjectsList,StartsWith(Title, ProjectsSearchBox.Text), ProjectStatus.Value=ProjectStatusDropdown.Selected.Value, ProjectLead.Email=User().Email, "Title")

 

I would like to create an exception to this filter for 2-3 users, which I believe can be achieved through an "If" statement before this filter. Would someone be able to help me with the correct syntax? I can't quite seem to figure it out.

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@holtma The simplest way to do that would be to have a variable in the OnStart(),

Set(gblAdminUsers, Table({Email:"admin1@yourcompany"}, {Email:"admin2@yourcompany"}))

 

Then alter the Filter like this,

SortByColumns(
  Filter(
    ProjectsList, 
    StartsWith(Title, ProjectsSearchBox.Text)&&
    ProjectStatus.Value = ProjectStatusDropdown.Selected.Value &&
    (ProjectLead.Email = User().Email || User().Email in gblAdminUsers)
	), "Title"
)

View solution in original post

3 REPLIES 3
CNT
Super User
Super User

@holtma The simplest way to do that would be to have a variable in the OnStart(),

Set(gblAdminUsers, Table({Email:"admin1@yourcompany"}, {Email:"admin2@yourcompany"}))

 

Then alter the Filter like this,

SortByColumns(
  Filter(
    ProjectsList, 
    StartsWith(Title, ProjectsSearchBox.Text)&&
    ProjectStatus.Value = ProjectStatusDropdown.Selected.Value &&
    (ProjectLead.Email = User().Email || User().Email in gblAdminUsers)
	), "Title"
)
holtma
Frequent Visitor

Thank you @CNT ! This solution works

@holtma Glad to help!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,686)