cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
indhaa
Responsive Resident
Responsive Resident

Get EmployeeID on Powerapps

Hi,

 

Can someone help me how to get this done. I have combo box for search to get all the relevant fields to be filled automatically when you select a user. However I don't know how to get the employeeID.   

 

Office365Users.SearchUser({searchTerm:PeoplePicker.SearchText})

 

indhaa_0-1612715118235.png

 

if someone can guide me how to do this. This is a submission form so the data need to be prompted in this screen. I saw some documentation that this attributes can be retrieved now but I haven't clue how to do it, Any help will be appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Steveo1
Advocate I
Advocate I

To avoid using the Microsoft Graph, you will need to do this in a Power Automate Flow.  See my sample Flow below.

Steveo1_2-1613230450856.png

In the OnChange property of my Email card's DataCardValue, I put this expression.  GetEmployeeId is the name of the Flow, and it accepts one parameter, the email (or UserPrincipalName):

Set(Employee, GetEmployeeId.Run(DataCardValue2.Text))

Then for the Default value of my EmployeeId data card, I set it to the value below.

Steveo1_3-1613230868563.png

 

Steveo1_1-1613229888482.png

 

 

View solution in original post

15 REPLIES 15
Jeff_Thorpe
Super User
Super User

Is the employeeID the same as the email address or UPN (account login) or something else?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
indhaa
Responsive Resident
Responsive Resident

No. employeeID is an attribute on Azure AD. I can see documentation on how it can be implemented via power automate and also using the Microsoft graph rest API but I don't know how to connect it to my PowerApps screen. Maybe I have to use SharePoint list and generate the data from it. Any help

Jeff_Thorpe
Super User
Super User

The Employee ID isn't part of the O365 User connector, so I am not sure how you would use a pre-existing connector to get that data in Power Apps. You mention you saw documentation about how to do this in Power Automate. Did it show a HTTP connector making a call to the MS Graph API to get the data? If you can get the data through the MS Graph then you could create a custom connector that Power Apps could use to get the data.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
indhaa
Responsive Resident
Responsive Resident

Hi

 

Since HTTP is a premium connector,  I'm trying if I can retrieve employeeID  with solution provided below without using MS Graph but still not able to grasp what he did. Can I get your input on this?

https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-get-Employee-ID-from-AD/m-p/373437

 

Hi @indhaa ,

Let me clarify. What you need is the AzureAD ID of the selected user in combobox ?

Well, I guess the simpliest way is to use AzureAD connector (standard one) like this:

AzureAD.GetUser(Peoplepicker.Selected.Mail).id

 

Hope it helps !

indhaa
Responsive Resident
Responsive Resident

Hi

 

I'm talking about the employeeID attribute.  https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0

 

indhaa_0-1613220150982.png

 

 Any idea how to get that?

Sorry .. it seems that i have misunderstood your issue.

Steveo1
Advocate I
Advocate I

To avoid using the Microsoft Graph, you will need to do this in a Power Automate Flow.  See my sample Flow below.

Steveo1_2-1613230450856.png

In the OnChange property of my Email card's DataCardValue, I put this expression.  GetEmployeeId is the name of the Flow, and it accepts one parameter, the email (or UserPrincipalName):

Set(Employee, GetEmployeeId.Run(DataCardValue2.Text))

Then for the Default value of my EmployeeId data card, I set it to the value below.

Steveo1_3-1613230868563.png

 

Steveo1_1-1613229888482.png

 

 

View solution in original post

indhaa
Responsive Resident
Responsive Resident

Hi

 

Thanks for the help. Were you able to get the employeeId?. I'm still getting an error. Let me know how you did this part. I cannot see employeeID as an available field

indhaa_0-1613236317630.png

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (87,007)