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 / OnStart Create Variabl...
Power Apps
Answered

OnStart Create Variable and Run Flow Error

(0) ShareShare
ReportReport
Posted on by 1,401 Moderator

I'm very new to PowerApps.

 

I am trying to get the EmployeeID of the person using a PowerApp from Azure using a Flow as shown here: https://stackoverflow.com/questions/69223207/can-we-get-active-directory-property-named-employee-id-using-office365users-conn

 

I am trying to run this flow "OnStart" of the "App" using "Set(varEmployeeID, GetEmployeeId.Run())". The error says "Incompatible type. We can't evaluate your formula because the context variable typs are incompatible with the types of values in other places in your app."

 

I have a "Label" that is trying to display the result of this Flow using "varEmployeeID.employeeid"

 

It seems like I need to change the "Label" so that it can accept the result of the variable, but I'm not sure how.

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

    @IPC_ahaas 

    I would do a search of the app to see where else you are using varEmployeeID.  The error you are seeing is stating that in some place in your app you are assigning something different to the variable.

    In other words, if you have one place in the app where you set a record to a variable and then another where you try to set a string to the same variable, you will get that error.

     

    I hope this is helpful for you.

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Should it not be this?
    Set(varEmployeeID, GetEmployeeId.Run().EmployeeId) then in the label it is varEmployeeID.

     

    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
    YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
    Twitter: https://twitter.com/phipps0218

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    I did a search, and it's not being used anywhere else.

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    I gave that a try, and now my "Label" says "The property on this control expects Text values. The rule produces Error values which are incompatible."

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

    @IPC_ahaas 

    What is the return value from your Flow?  It should be listed/named in the Return to PowerApps ending block of the flow.

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    It returns the Employee ID field value

    IPC_ahaas_0-1657136214558.png

     

    from Azure

    IPC_ahaas_1-1657136311982.png

     

     

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

    @IPC_ahaas 

    So yes then, you should have a .EmployeeID property returned from the flow.

    Set your formula to: Set(varEmployeeID, GetEmployeeId.Run().EmployeeId) and see if you are getting the value from the flow properly.

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    The first screenshot in my previous comment shows that I'm getting "employeeid""8521" in the Output. Could this be because of the Schema in the "Parse JSON" step?

     

    {

      "type""object",

      "properties": {
        "employeeId": {
          "type""string"
        },
        "@odata.context": {
          "type""string"
        },
        "@odata.id": {
          "type""string"
        }
      }
    }
     
    It has "type": "string" and the error in PowerApps says "The property on this control expects Text values."
    Do I need to convert this string to text somehow?
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @IPC_ahaas 

    Not so concerned over the flow return schema, but more about what you get IN your App.

    So if you put a button in your app (let's just use that to troubleshoot) and set the OnSelect action formula to:

    Set(varEmployeeID, GetEmployeeId.Run().EmployeeId) 


    What do you get??

  • IPC_ahaas Profile Picture
    1,401 Moderator on at

    I know part of my issue is not fully understanding how all of this works.

     

    I added a button and put the formula as the "OnSelect". It has three issues:

     

    IPC_ahaas_2-1657139548106.png

     

    'Run' is an unknown or unsupported function in namespace 'GetEmployeeId'

     

    Invalid use of '.'

     

    Incompatible type. We can't evaluate your formula because the content variable types are incompatible with the types of values in other places in your app.

     

    The Flow is in the App (so far as I can tell)

    IPC_ahaas_0-1657139466010.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard