web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to Get MangerId Wo...
Power Automate
Unanswered

How to Get MangerId Working

(0) ShareShare
ReportReport
Posted on by 66

Dear all,

 

Here is the problem i'm stuck on creating my first flow.

We wanted to populate a SharePoint List form who contain all of ours users, to make an Orgchart.

Populating the SharePoint List with only users and some information like services or department was easy.

I'm stuck trying to add the ManagerID.

 

Here is the process below

Part 1 = i collect all of our users -> working

Part 2 = i normally collect the manager of all users -> not working

Part 3 = Sharepoint List is updated from the flow -> Working without part 2

 

Any help will be really appreciate.

As the screenshot is in French let me know if there is any need of traduction.

 

Capture d’écran 2021-02-10 à 15.15.01.png

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,183 Most Valuable Professional on at

    Hi @deCastroTony,

     

    As far as I can tell you are using the UserPrincipalName of the user to retrieve the manager with a Get Manager (V2) action, correct? Normally that should work, unless the user doesn't have a manager.

     

    What do you mean by it's not working, are you getting an error when you test run it?

     

    And just to double check. What kind of column is the ManagerID in your SP_INF list. Is it a person or group type of column?

     

  • deCastroTony Profile Picture
    66 on at

    hi @Expiscornovus thanks for your answer.

     

    In fact i'm totaly stuck at the Sharepoint process.

    I don't know what kind of ID is required into the "update element"

     

    Capture d’écran 2021-02-11 à 09.11.48.png

    Concerning the Sharepoint SP_INF list the value Manager was not set as a person or groupe.

    (done after the first screenshot it was first configured as "search")

     

    Capture d’écran 2021-02-11 à 09.13.39.png

     

    Thanks for your help i appreciate.

     

    Many Thanks.

     

  • Expiscornovus Profile Picture
    33,183 Most Valuable Professional on at

    Hi @deCastroTony,

     

    Normally in a update item you will use the id of the existing item. I would use a get items first to retrieve the work email and id first.

    example_idupdateitem.png

     

    Below is an example of that approach.

     

    1. Add a Get Items action and retrieve your SP_INF items.

    You could potentially add a filter query to only retrieve the items where the manager field is empty, btw.

    getitems_spinf.png

     

     

    2. Add a Get user profile (V2) action. Use the Work Email field from the SP_INF list as input.

    This will create an apply to each loop btw.

    getuserprofile.png

     

    3. Add a Get Manager (V2) action within the loop. Use the User Principal Name field from the Get User Profile action as input

    getmanagerv2.png

     

    4. Add an Update Item action within the loop. Use the ID from the Get Items action.

    In this example I used the User Principal Name of the Get User Profile action for the title and the Work Email field from the Get Items action for the Work Email fields btw.

    updateitem_spinf.png

     

    5. Use the User Principal Name field of the Get Manager action for the Manager Claims field (Person or Group field).

    userprincipalname_getmanager.png

  • Verified answer
    deCastroTony Profile Picture
    66 on at

    Thanks for you help @Expiscornovus,

     

    I understand now better the difference concerning the Sharepoint parts.(Creating / updating)

    In fact the List Name SP_INF is not populated yet as i deleted all the content for testing purpose.

    I choosed the update items because each time i run the flow, users are duplicated.

    Also news users can join us every day, i need to update this item on daily basis.

    I will do some try with your recommendations.

     

    In order :

    0 -> Every night the flow is starting

     

    Collecting data from the SharePoint List 

    1-> Get items

     

    Need to collect all my 365 users doing a :

    2-> get all users 

     

    Populate the Sharepoint List doing :

    3 -> Create a sharepoint element

    Title = upn

    This part Create each users with some details excepted Manager details => working

     

    Lets continue :

    In the same loop

    3 Get users profils

    4 Get manager

    5 Update item

     

    The flow stop here I got an error saying too long.

    Also if i restart the flow, users are duplicated.

    Any idea ?

    Capture d’écran 2021-02-11 à 14.43.31.png

     

  • Expiscornovus Profile Picture
    33,183 Most Valuable Professional on at

    Hi @deCastroTony,

     

    I now understand a bit better what you want achieve. I might need to adapt the flow example to that.

     

    However, before we continue to the store everything in a SharePoint list I have a question.

     

    Have you seen by any chance the new Organization chart web part in SharePoint? That web part is using the manager field from Azure Active Directory/profiles to generate an org chart. Maybe that is a good alternative?

     

    organizationchart.png

     

    organizationchart_webpart.png

  • deCastroTony Profile Picture
    66 on at

    Many many thanks to taking time to help me.

    Yes for sure we look into the sharepoint module but doesnt fit to our organisation.

    We are going to use another product for that : SharePoint Org Chart | Plumsail

    Many Thanks.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard