Inside our active directory we have a property named "Employee ID" as follow:-
so inside our PowerApp form i want to get the value of this property,,, but i checked the Office365Users connector @ https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-users seems it does not provide such a data.. so how i can get the Employee ID property inside our PowerApp form? this ID is different than the ID which we can get using this formula Office365Users.MyProfile().Id
which will return the internal GUID of the user, and not the number shown above.
Thanks in advance for any help.
Currently (As of 2021-09-27), there is no Out of the box connector for Power Apps that will get you employeeId. The reason is that we need to query the beta version of Microsoft Graph, as it is not query-able in the version 1.0 of the endpoint. There is hope, the new Office 365 Users Connector has a new version of Get my profile (V2) that queries the new version of the Graph interface, and allows us to select employeeId
, as well as almost everything else available. The downside is that it returns a GraphUser_V1 object. So, even though the API call returns the employeeId
, since Power Apps is Strongly Typed, we cannot reference employeeId
as it's not a part of the GraphUser_V1
object.
Power Apps may not be able to pull the value, but Power Automate can. As a POC to get you started:
employeeId
body
of Get my profile (V2)
:
@{outputs('Get_my_profile_(V2)')?['body']}
{
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"@@odata.id": {
"type": "string"
},
"employeeId": {
"type": "string"
}
}
}
EmployeeId
@body('Parse_JSON')?['employeeId']
Button1.OnSelect
to: Set( varEmployeeID, GetEmployeeId.Run())
Label1.Text
set to: varEmployeeID.employeeid