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

Re: How to get Employee ID from AD.

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

Re: How to get Employee ID from AD.

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
Helper III
Helper III

Re: How to get Employee ID from AD.

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

Highlighted
Dual Super User II
Dual Super User II

Re: How to get Employee ID from AD.

@_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

Re: How to get Employee ID from AD.

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

Re: How to get Employee ID from AD.

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
Helper III
Helper III

Re: How to get Employee ID from AD.

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

 

Thanks

Highlighted
Memorable Member
Memorable Member

Re: How to get Employee ID from AD.

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
Frequent Visitor

Re: How to get Employee ID from AD.

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
Advocate I
Advocate I

Re: How to get Employee ID from AD.

@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
Frequent Visitor

Re: How to get Employee ID from AD.

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

Highlighted
Advocate I
Advocate I

Re: How to get Employee ID from AD.

@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
Frequent Visitor

Re: How to get Employee ID from AD.

@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
Advocate I
Advocate I

Re: How to get Employee ID from AD.

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
Frequent Visitor

Re: How to get Employee ID from AD.

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

Highlighted
Advocate I
Advocate I

Re: How to get Employee ID from AD.

@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
Frequent Visitor

Re: How to get Employee ID from AD.

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
Advocate I
Advocate I

Re: How to get Employee ID from AD.

@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
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.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Users online (4,707)