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?
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:
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.
If you believe there is a use case for this please post an idea here:
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.
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.
I believe profile photos are not working 'yet', but they are intended via the User() Function:
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.
Office 365 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,
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.
Check out new user group experience and if you are a leader please create your group
Next call is happening on April 21st at 8a PST.
May the fourth be with you, join us online!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.