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

Write the Office 365 Manager to a SharePoint Data List

I have a flow that uploads excel data to a SharePoint List. One of the columns is for an employee name/email and I want to write the given name Manager and Manager Email from Get Manager Action to the column Manager Name and Manager Email.
Also another requirement is to get the Manager( 2nd level mgr) of the Manager above( 1st level mgr) to write the results in the columns for Department Manager Name and Department Manager Email.
Hence I need to write the required name and email of two levels of manger in the SharePoint List.
What is the optimal solution for my flow? How do I get the name and email of the managers then convert it to string for data list input?
9 REPLIES 9
dvdalen
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

I've set up a test case for you:

 

ManagerofManager.png

 

Is this what you mean?

 

If the manager field is not configured the Get Manager action will fail. With a parallel action you can configure the run after propertie so you manage this scenario. 

yellowsubmarine
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

Hi @dvdalen ,

 

Forgot to add in the excel upload there is an Employee Name or Email column, what I am trying to achieve is to get the Manager Name and Email of that employee. Then the result will be written to columns for Manager Name and Manager Email. 

 

After getting the 1st level manager from above requirement I need to get the 2nd level manager.That will be the Manager of the Manager of the employee then this will be written in columns for 2nd Level Manager Name and 2nd Level Manager email. To put it into context Get Manager info (Supervisor of the employee) then Get Manager info ( Line Manager of the Supervisor).

dvdalen
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

but what is the problem you experience? Is it the update list actions? I thought it was to get the details of the 2 managers.

yellowsubmarine
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

@dvdalen how do I get the UPN of that employee then get Managet info then write it to sharepoint list?
dvdalen
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

Best practise is to use the email address as the upn, isn't that the case? You can check if you get results when you put the email adres in the Get user profile (V2) action and see if you get the result. 

 

If you do get the profile from the user you can then use the action Get manager (V2) and put the email adres as input as I did in my example. You can also use the Id field that you get from the Get user profile (V2) action as you can see in this example:

 

2019-04-25 08_04_26-Create your flow _ Microsoft Flow.png

yellowsubmarine
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

Hi @dvdalen ,

 

For the Get Manager V2 to work is it always dependent to have Get User Profile V2 before the step?

 

Hence if I want to get the line manager of the manager should it be like this?

 

Employee > Get User Profile > Get Manager > Get User Profile > Get Manager

 

 

dvdalen
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

No that is not required. 

 

you only have to provide the get manager action the upn / email adres of the person that you want to have the manager from. As you can see in my example I checked the manager of the manager without a get user profile action in between.

yellowsubmarine
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

@dvdalenbelow is what I have created. ManagerLookUp.png

 

What I am trying to achieve is upon importing the excel data table to SP Datalist the columns for the Employee's Supervisor Name and Supervisor Email columns will be populated with the use of Get User Profile. Aside from getting the Supervisor Name I need to also get the Name and Email to to whom Supervisor Reports to and write the result to Manager Name and Manager Email column. The error that I am getting is that I am having a bad request error.

dvdalen
Level: Powered On

Re: Write the Office 365 Manager to a SharePoint Data List

Can you provide a picture of the last step create item

And a picture of the error you receive?

 

You do realize that your SharePoint list will be filled with double data? Every time you manually trigger this flow all the rows from the excel sheet will be imported in to the sharepoint list. 

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 179 members 5,357 guests
Please welcome our newest community members: