I found a great tutorial on creating an OrgChart from Office365 data thanks to Keith Craigo: https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/PowerApps-Department-Org-Chart/bc-p/1277866 and I have it working perfectly - thanks @KC !
I would however like to change the datasource to a Sharepoint list as my organisation's internal data is richer and more accurate than O365. Has anyone had experience doing this or seen a tutorial on how to do it?
Any advice would be very much appreciated
thanks @Anonymous_Hippo that looks like a pretty thorough solution cheers 🙂
Hello @bobgodin ,
I have created what you are looking for 🙂 not sure if this exactly matches your requirement but i'm sure you can recycle large part of it.
Warning very long post 🙂
You will need to create two flows
Lets start with an example If you are trying to extract org chart for all of IT department - lets say that the IT SVP is Liz.
First step is to create a list and input this person's email address - so it should look something like this - here rename the title column to email.
Second step is to create our main org chart list
Add the following columns
Now lets look at the first flow - this flow will pull this information from this SP list and then add this to our main org chart SP list
-The flow will delete our main org chart SP list every month so that we can update it every month to capture people leaving and joining
Add HTTP action
URI :
https://prod-185.westus.logic.azure.com:443/workflows/6f7db3872bd147dea22aae824f1f366f/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=oOZxbH06izAipViXwNGLeXAxqYHSmt1TXa-GzSuesPY
Body
{
"SiteURL": "Input your SP site address",
"ListGuid": "Input your SP list ID which has your org chart info"
}
Add SP Get Items - here select the first list that you created which has our IT SVP's email address
Then add initialize Variable - add this as an expression
outputs('Get_items_Employee_Email_Configuration')?['body/value'][0]['Title']
Next add Get Top user profile - here add the value of variable in the user field then add Get Manager and add dynamic content - mail from the previous step
Now we create the first item of our Org chart SP list - Add Create item action. Here remember to input the Org chart SP list name and add the values of title, jobtitle and other fields from the dynamic content field of "Get Top user profile" and for the manager name you can use "Get manager" output
Below is how your flow should look
Next let us look at flow 2
Flow 2 will extract the direct reports of the item that gets created . Please add all the steps shown below
In the first step add Org chart SP list.
length(outputs('Get_direct_reports_(V2)')?['body/value'])
Next add apply to each step - inside condition step add Accounts enabled = true
Here is how it should look
JobTitle:
coalesce( items('Apply_to_each')['jobTitle'],null)
Department:
If(empty(items('Apply_to_each')['department']),null,items('Apply_to_each')['department'])
Hopefully this is helpful
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.