cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarenD
Helper III
Helper III

SharePoint REST API Call with Power Automate - Get user profile

I’m very new (like this is my first time) trying to do this and could use a little help in working out the process. I’ve reviewed, literally, dozens of websites and I can’t seem to find one that has helped.  Pretty sure it’s me!

 

I would like to use Power Automate to pull the following fields, employeeid and employeeOrgData

, from the SharePoint User Profile using the respondent’s email from a MSFT FORM.  I’m currently pulling other data from AAD using the O365 Get User & Manager connector, so I can use fields from that if needed to pull the right data from the SharePoint User Profile.  Once the data is received I will need to populate fields in a SPO list.

 

I’m positive this has been done before, can anyone help me with how to do this?   

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @DarenD 

 

Try Get user profile (V2)

 

image.png

 

Then add a compose action step and try the below expression to get the employeeid

 

outputs('Get_user_profile_(V2)')?['body']?['employeeId']
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

9 REPLIES 9
abm
Super User
Super User

Hi @DarenD 

 

To get all properties of the current user you could use the below REST API

 

_api/SP.UserProfiles.PeopleManager/GetMyProperties

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

abm,

  that did seem to work in connecting me to the SPOL User Service.  Does it work the same way if trying to get data from Graph?  I'm trying to specifically get the employeeid and employeeOrgData.  None of those are returned when I ran my HTTP Request.

 

Resource Link: https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties 

 

Connector Configuration:

Graph_API_Employee_Details.png

abm,

  Just to add some clarification I also did a the sample test in the link I provided and this is what I received back:

 

Error: But I'm actually in the tenantError: But I'm actually in the tenantThis is the code I usedThis is the code I used

Hi @DarenD

 

Thanks for the reply. Is this a sync issue?

 

About user profile synchronization - SharePoint in Microsoft 365 | Microsoft Docs

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

I don't think so since the tenant I'm using is cloud only no On-Premise activities. 

I've also expanded the HTTPS so you can see the rest of the information:

 

Graph_API_Employee2_Details_Updated.png

Hi @DarenD 

 

Whats the HTTPS JSON data looks like? Is that contains the schema names you after?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Here's the JSON from All Users Code & Specific User using UPN

 

Graph_API_Employee3_Error_Details.pngGraph_API_All_Employee3_Error_Details.png

Hi @DarenD 

 

Try Get user profile (V2)

 

image.png

 

Then add a compose action step and try the below expression to get the employeeid

 

outputs('Get_user_profile_(V2)')?['body']?['employeeId']
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Kudoed Authors
Users online (2,655)