Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Trying to connect Orgchart built using Office365 data to a Sharepoint list instead

Posted on by 353

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

Categories:
  • Verified answer
    bobgodin Profile Picture
    bobgodin 353 on at
    Re: Trying to connect Orgchart built using Office365 data to a Sharepoint list instead

    thanks @Anonymous_Hippo that looks like a pretty thorough solution cheers 🙂

  • Verified answer
    Anonymous_Hippo Profile Picture
    Anonymous_Hippo 1,247 on at
    Re: Trying to connect Orgchart built using Office365 data to a Sharepoint list instead

    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.

    Anonymous_Hippo_0-1658634873688.png

    Second step is to create our main org chart list

    Add the following columns

    1. Rename title to Name
    2. Employee - Person or group
    3. Nick Name -single line text column
    4. Employee Email ID - Person or group
    5. Reporting manager - Person or group
    6. Department - single line text column
    7. JobTitle - single line text column

    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

    1SC.png

    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

    Anonymous_Hippo_1-1658636658850.png

     

    Then add initialize Variable - add this as an expression

    Anonymous_Hippo_2-1658636678546.png

    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

    Anonymous_Hippo_3-1658636712369.png

    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

    Anonymous_Hippo_4-1658636739914.png

     

    s2.png

    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

    Anonymous_Hippo_5-1658637287891.png

    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

    Anonymous_Hippo_7-1658637502666.png

    Here is how it should look

    Anonymous_Hippo_8-1658637546091.png

    JobTitle: 

    coalesce( items('Apply_to_each')['jobTitle'],null)

    Department:

    If(empty(items('Apply_to_each')['department']),null,items('Apply_to_each')['department'])

    s3.png

    Hopefully this is helpful 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard