web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Users.MyProfi...
Power Apps
Answered

Office365Users.MyProfileV2('$select:'

(0) ShareShare
ReportReport
Posted on by 5

I have an app that needs the employeeId field from Azure AD.  I've set up a flow and passed the employeeId back to PowerApps, but I was hoping to find a way to do it with a direct connection from PowerApps.  I've found documentation on the Office365 Users connection that says that you can select additional fields outside of the default ( https://docs.microsoft.com/en-us/connectors/office365users/).  IntelliSense gives a {'$select': option on Office365Users.MyProfileV2().

I've created a button to do the following:

Set(varUserV2Select,Office365Users.MyProfileV2({'$select':"userPrincipalName,employeeId,displayName,mail,mailNickname"}))

I can still only get to all of the default fields.  I can't figure out how to get to employeeId.  Is this even possible, or am I reading too much into the documentation?

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @mandi-parker 

    Yes...reading a little too much into the documentation!

    Although you can pass the fields that you want to return, you can still only access the values that there are properties for on the GraphUser object that is returned.  If there was an employeeId property on that, then it would work, but there is, sadly enough, none at this time.

     

    Not the answer you expected perhaps, but I hope it helps.

  • mandi-parker Profile Picture
    5 on at

    Thank you, @RandyHayes 

     

    So select is a way to limit the data returned and not to get to additional fields available through the Graph API for Get User, then.  Does anyone have any other ways to get to this other than going through flow?  Custom connection to Graph API through PowerApps?  Thanks!

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @mandi-parker 

    Yes, you can do a custom connector.  I've done that in the past to get around the issue. But, it is a custom connector (mind you license) and it does require some steps to put in place.

    However...word on the street is that PowerApps will soon be able to access the Graph API more completely - this is purely anecdotal based on a conversation from Build this year, I cannot confirm it.

  • indhaa Profile Picture
    on at

    @RandyHayes Any change to this. I can see employeeID on the documentation but don't know how to retrieve it.

     

  • HAL9256 Profile Picture
    2 on at

    @indhaa 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 has the capability to return 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:

    1. In Power Apps, create a button with the Action being running a Power Automate Flow.
    2. Create a new flow "Power Apps button" called "GetEmployeeId".
    3. In Power Automate, create a new step: Get my profile (V2).
      • Under advanced options set Select fields to employeeId
    4. Create a new step: Parse JSON
      • Set Content to the body of Get my profile (V2): @{outputs('Get_my_profile_(V2)')?['body']}
      • Set Schema to:
    {
     "type": "object",
     "properties": {
     "@@odata.context": {
     "type": "string"
     },
     "@@odata.id": {
     "type": "string"
     },
     "employeeId": {
     "type": "string"
     }
     }
    }
    
    1. Create a new step: Respond to a PowerApp or flow
    2. Add an output type Text:
      • Enter title : EmployeeId
      • Enter in a value to respond : @body('Parse_JSON')?['employeeId']
    3. Save the Power Automate flow and test it. You will have to approve O365 access permissions. The whole flow should look like this:
     
     

     

    1. Back in Power Apps, Connect your new flow to the app.
    2. Set your Button1.OnSelect to: Set( varEmployeeID, GetEmployeeId.Run())
    3. Create a label with the Label1.Text set to: varEmployeeID.employeeid
    4. Run the app and click the button to test.
  • indhaa Profile Picture
    on at

    Hi,

     

    Thanks for the reply. I have already done this on my App.

  • santy2 Profile Picture
    15 on at

    Hi

     

    Here it's an example of you can grab the employeeId ;

    https://github.com/MicrosoftDocs/BusinessApplicationPlatform-Connectors-public/issues/23#issuecomment-1353886508

     

    Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard