cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cmsherro
Level: Powered On

Expanding on the Org Browser PowerApp

Hi,

 

My company really likes the Org Browser PowerApp.  However, I have the need to search by department and then display how many employees are in each department.  Also, an overall count how many are in each department ex.  Marketing (8). 

 

I'm having a hard time figuring out what connections to use.  I've tried the different office365users. connections and am not being successful at what I need to do.  Am I supposed to create aother collection with just the information that I need as table? What is the appropriate fuction to get the department data?  

 

Thanks! 

6 REPLIES 6
audrieg
Level 10

Re: Expanding on the Org Browser PowerApp

Good morning cmsherro,

 

If I understand correctly, you are trying to extend the Org Browser app so you can count the number of users associated to the department of the selected user, or just simply get a count of all users in a particular department.

 

You may have noticed the count of Direct Reports on the second screen, with hopes that you can expand upon that. It's true at first glance that formula looks promising:

"Direct reports " & "(" & CountRows(Office365Users.DirectReports(First(Employee).Id)) & ")"

 

However, Office365Users. intellisense will not go directly to "Departments" as it does with "DirectReports" although it will return the department of a selected/identified user. See this reference:

https://powerapps.microsoft.com/en-us/tutorials/connection-office365-users/

 

I was able to count the results of a SearchUser formula, but the search user formula only allows for search of display name, given name, surname, mail, mail nickname, and user principal name. So I don't believe it's possible to count all users in the Marketing Department unless their email alias, or mail nickname, could give that away. Azure Functions / Graph API may be the way to go for your goal - but I have not tried that yet.

 

searchuser.PNG

 

If you believe there is a use case for this please post an idea here:

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

 

Audrie

 

 

 

P.S. There have been reported issues of the org browser not working on the phone. I will look into that and see if I can learn why that is occurring for you.

 

 

 

 

cmsherro
Level: Powered On

Re: Expanding on the Org Browser PowerApp

Thanks Audrie.  Also, Is there away to get the employee photo?  Based on the office 365 users connections it doesn't look possible.  I'm also trying to expand on the search query for employee name and add a 'department search' to the original search on the first screen.   Have you tried that?  

 

I'm going to look into the Azure/ graph api information that you sent.  It looks so far, that I might better off creating a sharepoint list with all the user profile attributes that I need and then bringing that data in through the powerapp.  I'm just hoping I don't have to do all of that.  

 

Thanks  

audrieg
Level 10

Re: Expanding on the Org Browser PowerApp

I believe profile photos are not working 'yet', but they are intended via the User() Function:

 

user.PNG

 

 

You should be able to query for the Department of a user. In the Org Browser PowerApp you can see an example of query for department on the first and second screens. However, as stated in my last post SearchUser only supports: name, given name, surname, mail, mail nickname, and user principal name.

 

Just take note that all profile queries are related to a particular principal account. As far as I know today, there isn't a way to ask for "All" users without a user anchor, and that type of query (which results in a plural result) appears to be for direct reports only.

 

References:

User() Function

https://powerapps.microsoft.com/en-us/tutorials/function-user/

 

Office 365 Users

https://powerapps.microsoft.com/en-us/tutorials/connection-office365-users/

 

I would not recommend using a SharePoint list to manage user profile information even though technically it would be easier for you to query. The short story reason is that the maintenance of the data can degrade the quality of the app. I will do a bit of investigation for you on the Graph API, and will let you know if it can help you. (In the meantime I will subscribe to this thread in case others provide a better solution.)

 

With every constraint we can usually find a way with APIs....although you may need additional set-up in Azure to make it work.

 

Thank you again,

Audrie

audrieg
Level 10

Re: Expanding on the Org Browser PowerApp

One last question: Are you an Office 365 Tenant Admin?

cmsherro
Level: Powered On

Re: Expanding on the Org Browser PowerApp

Thanks again. Yes I am.

Nikhilsharma8
Level: Powered On

Re: Expanding on the Org Browser PowerApp

Is there a way to search by last name and first letter of first name. I get a search result if i just search for last name, first name or full name, but no result based on the search i mentioned in first line.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 424 members 6,746 guests
Please welcome our newest community members: