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

How to get Employee ID from AD.

Hi,

 

I'm working on a leave request workflow and I'd like to be able to pull the employee's ID. This data comes from AD. I looked in the "Get user profile" but there isn't an option to get the employee ID. 

 

Any ideas? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Hi @_sourcecod3_ 

 

It's easy 😄

 

Just use the Azure AD (Get User) passing the user email.

image.png

 

 

It's brings the ID as the first fieldimage.png

 

Hope this helps


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

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

17 REPLIES 17
Highlighted
Dual Super User II
Dual Super User II

Hi @_sourcecod3_ 

 

Get user profile only fetches basic list of properties

Any custom properties(extension attributes) - graph api will be the option

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted

@RezaDorraniThanks for your response. Do you happen to have any resources where i can find more information on that? 

Highlighted

@_sourcecod3_ 

 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Access-Azure-AD-Custom-Extension-Attributes-in-M...

check comments on this idea

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Memorable Member
Memorable Member

Hi @_sourcecod3_ 

 

It's easy 😄

 

Just use the Azure AD (Get User) passing the user email.

image.png

 

 

It's brings the ID as the first fieldimage.png

 

Hope this helps


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

Gustavo Moraes, o astronauta brasileiro do Flow!


View solution in original post

Highlighted
Community Support
Community Support

Hi @_sourcecod3_,

 

Has your problem been solved?
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Highlighted

@gamoraesThanks and I apologize for the late response. What other attributes will this provide? 

 

Thanks

Highlighted

Hi

 

The return have:

 

Id
id string

A unique identifer for the user.

Business Phones
businessPhones array of string  
Display Name
displayName string

The name displayed in the address book for the user.

Given Name
givenName string

The given name (first name) of the user.

Job Title
jobTitle string

The user’s job title.

Mail
mail string

The SMTP address for the user.

Mobile Phone
mobilePhone string

The primary cellular telephone number for the user.

Office Location
officeLocation string

The office location in the user's place of business.

Preferred Language
preferredLanguage string

The preferred language for the user. Should follow ISO 639-1 Code; for example 'en-US'.

Surname
surname string

The user's surname (family name or last name).

User Principal Name
userPrincipalName string

The user principal name (UPN) of the user.

 

 

 
     

 

The full documentation is here


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

Gustavo Moraes, o astronauta brasileiro do Flow!


Highlighted

This took a lot of trial and error but I finally was able to get the employeeId from the Get User Profile (V2) connector.

Click "Show Advanced Options" on the Get User Profile connector. Enter the data elements you want returned in the Select Fields text box. (I don't know why it doesn't just return all of them.)

Screen Shot 2020-05-19 at 5.45.07 PM.png

After the Get User Profile (V2) connector add compose and parse JSON data connectors.

 

Flow_Image.png

 

 

You can find the JSON schema here: https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#json-representation 

From there you should be able to find the user profile data in the dynamic content in the connector where you need to use it. 

 

Hope this helps!

Highlighted

@ToddAtLSUHSC I can't get the parse JSON to give me anything additional to what I get from the get user V2 action.  Any pointers where I could be going wrong? 

Highlighted

Can you post a screenshot of what you have? Thanks.

Highlighted

@ToddAtLSUHSC 

Here's what I've got, not sure if I got the JSON schema right but it didn't give me any errors 🙂2020-05-19 23_38_07-Edit your flow _ Power Automate and 19 more pages - Work - Microsoft​ Edge.png

Highlighted

@robofski My bad. I forgot to add an important part to my post. You need to click "Show Advanced Options" on the Get User Profile connector. Enter the data elements you want returned in the Select Fields text box. I don't know why it doesn't just return all of them. Hopefully that is it.

Screen Shot 2020-05-19 at 5.45.07 PM.png

Highlighted

I wish I could double like this 🙂  That's it, perfect, **bleep** shame I have to select all the fields I want not just the additional ones, but for what I'm after this will be perfect.  Thanks @ToddAtLSUHSC 

Highlighted

I have updated my original post with the "missing" step. First mistake...since the last one. 😁

Highlighted

@ToddAtLSUHSC just looking at the output of the Get User Profile V2 and now I get the EmployeeID there so that would render the other steps unnecessary wouldn't it or am I missing something here?

2020-05-20 00_07_09-Run History _ Power Automate and 19 more pages - Work - Microsoft​ Edge.png 

Highlighted

Not sure what steps you are referring to. In my testing, before I figured it out, I could see the employeeId data in the run history, but I couldn't access it. It took who knows how many tests before I finally got it.

Highlighted

@ToddAtLSUHSC  and that's why you're the master and I'm the student, you are of course right, while it shows in the run history, it's not available in subsequent steps as dynamic data from the Get User Profile action.  Thanks again! 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (3,152)