cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filtering Office365Users by AccountEnabled ?

Hi,

 

I figure this should probably be pretty simple, but can't find the answer anywhere online.

 

All I want to do is type a users name in a text input box, and display a list of corresponding users in a Gallery with the "Title and subtitle" layout, where I select Title to be DisplayName and Subtitle to be JobTitle. 

 

I have got this working by selecting the gallery, and putting Items Fx= Office365Users.SearchUser({searchTerm: SearchName.Text})

 

However the problem is, we do not delete users from AD / Office365 when they leave, they are only disabled. However, the Gallery still automatically populates with all the disabled users too. I can't quite figure out how to filter them out using "AccountEnabled = true" of some sort. 

 

Any advice appreciated..

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Boneckrh19
Level 8

Re: Filtering Office365Users by AccountEnabled ?

This is the code I have which filters out all users for which AccountEnabled is false:

 

Filter(Office365Users.SearchUser({searchTerm:""}), AccountEnabled = true)

3 REPLIES 3
Community Support Team
Community Support Team

Re: Filtering Office365Users by AccountEnabled ?

Hi @Anonymous,

 

According to Connect to Office 365 Users connection from PowerApps, Filter is not one of the available functions that you could use with Office 365 Users connector in PowerApps. The only function that is close to what you need is SearchUser function. But the Search string only applies to display name, given name, surname, mail, mail nickname, and user principal name. So it seems that you cannot search with AccountEnabled string. 

 

If you really need this, please consider to post an idea in the PowerApps Ideas forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Regards,

Mona Li

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Boneckrh19
Level 8

Re: Filtering Office365Users by AccountEnabled ?

This is the code I have which filters out all users for which AccountEnabled is false:

 

Filter(Office365Users.SearchUser({searchTerm:""}), AccountEnabled = true)

suriyac
Level: Powered On

Re: Filtering Office365Users by AccountEnabled ?

Was looking for this functionality as well and this works for me. You should be able to use the code provided by @Boneckrh19 under Items on your gallery. 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 266 members 4,409 guests
Please welcome our newest community members: