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

Hide a User in a Gallery

Hey guys!

 

I have a gallery reading Office365 Users, but there's one user I don't want to be in the Gallery.

Is there any function in particular that would work for this?

I have tried so many methods to hide just one user.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Hide a User in a Gallery

@lucia  Thank you so much!

 

I changed the Email to DisplayName and it worked!

 

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    Not("Display Name" in DisplayName),
    AccountEnabled = true,
)

I appreciate it thank you very much!

View solution in original post

10 REPLIES 10
Highlighted
Dual Super User III
Dual Super User III

Re: Hide a User in a Gallery

What is the items setting for the gallery?  Couldn't you just add an additional Filter() function around that to Filter out that one user?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Resolver II
Resolver II

Re: Hide a User in a Gallery

Hey,

 

When setting items in a galerry, u can use Filter() and as condition to be Not(user_u_donot_want_to_display in column).

 

So for example, if you know the email of the user u can use Filter(Datasource, Not(user_email in WorkEmail_field))

 

Hope this helps.

Highlighted
Helper I
Helper I

Re: Hide a User in a Gallery

@Pstork1 So far I have this in the Items:

 

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    AccountEnabled = true,
    If(
        Len(Department) < 1,
        Department = ddDepartment.Selected.Value,
        true
    ),
    If(
        ddDepartment.Selected.Value <> "",
        Department = ddDepartment.Selected.Value,
        true
    ),
        If(
        Len(Mail) > 1,
        true
    )
)

 

Highlighted
Helper I
Helper I

Re: Hide a User in a Gallery

@lucia  So far I have this code in the Items, where would I place the code you gave me?

 

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    AccountEnabled = true,
    If(
        Len(Department) < 1,
        Department = ddDepartment.Selected.Value,
        true
    ),
    If(
        ddDepartment.Selected.Value <> "",
        Department = ddDepartment.Selected.Value,
        true
    ),
        If(
        Len(Mail) > 1,
        true
    )
)  

Highlighted
Dual Super User II
Dual Super User II

Re: Hide a User in a Gallery

Hi @Andy_Prog 

 

Add UserPrincipalName<>"the user email" to your filter criteria

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Resolver II
Resolver II

Re: Hide a User in a Gallery

Hey, 

 

just put comma in your filter function and add the desirable condition.

 

 

Highlighted
Helper I
Helper I

Re: Hide a User in a Gallery

Hey @RezaDorrani,

 

I'm a little new to PowerApps, still learning. Here I provide my code I have so far, where would I place your code?

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    AccountEnabled = true,
    If(
        Len(Department) < 1,
        Department = ddDepartment.Selected.Value,
        true
    ),
    If(
        ddDepartment.Selected.Value <> "",
        Department = ddDepartment.Selected.Value,
        true
    ),
        If(
        Len(Mail) > 1,
        true
    )
)

Thank you!

Highlighted
Dual Super User II
Dual Super User II

Re: Hide a User in a Gallery

Hi @Andy_Prog 

 

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    AccountEnabled = true,
UserPrincipalName <> "enter the email here". If( Len(Department) < 1, Department = ddDepartment.Selected.Value, true ), If( ddDepartment.Selected.Value <> "", Department = ddDepartment.Selected.Value, true ), If( Len(Mail) > 1, true ) )
Highlighted
Helper I
Helper I

Re: Hide a User in a Gallery

@lucia  Thank you so much!

 

I changed the Email to DisplayName and it worked!

 

Filter(
    Office365Users.SearchUser(
        {
            searchTerm: txtInputEmployee.Text,
            top: 500
        }
    ),
    Not("Display Name" in DisplayName),
    AccountEnabled = true,
)

I appreciate it thank you very much!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,586)