cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Exclude a few users from Office365Users.SearchUser()

Hi,

i use template OrgBrowser in PowerApps but i have list (in Gallery) all users from Office 365 (like: admin, admin2). I don't want to see a few users account. How can i do? I have this code in Gallery:

 

If(!IsEmpty(SearchUser); Sort(Filter(Office365Users.SearchUser({searchTerm:First(SearchUser).Value}); Len(GivenName) > 0); GivenName; Ascending))

And i edit:

 

If(!IsEmpty(SearchUser);Sort(Filter(Office365Users.SearchUser({searchTerm:First(SearchUser).Value});Len(GivenName)>0,AccountEnabled = true; EndsWith(DisplayName, "- ADM"));GivenName;Ascending))

But didn't work.. Help, please.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Exclude a few users from Office365Users.SearchUser()

Hi @r_mro 

 

Use the below in your formula

 

If(!IsEmpty(SearchUser), Sort(Filter(Office365Users.SearchUser({searchTerm:First(SearchUser).Value}), Len(GivenName)>0 && AccountEnabled = true && EndsWith(DisplayName, "- ADM") ) , GivenName, Ascending))

 

Regards,

Reza Dorrani

 

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

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

Re: Exclude a few users from Office365Users.SearchUser()

Hi @r_mro 

 

Use the below in your formula

 

If(!IsEmpty(SearchUser), Sort(Filter(Office365Users.SearchUser({searchTerm:First(SearchUser).Value}), Len(GivenName)>0 && AccountEnabled = true && EndsWith(DisplayName, "- ADM") ) , GivenName, Ascending))

 

Regards,

Reza Dorrani

 

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

View solution in original post

Highlighted
Community Support
Community Support

Re: Exclude a few users from Office365Users.SearchUser()

Hi @r_mro ,

Is SearchUser a textinput control?

If so, try this formula:

If(!IsEmpty(SearchUser.Text);
Sort(
Filter(
Office365Users.SearchUser({searchTerm: SearchUser.Text});
Len(GivenName)>0;AccountEnabled = true; EndsWith(DisplayName, "- ADM")
);
GivenName;Ascending
)
)

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,874)