Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

"incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

(0) ShareShare
ReportReport
Posted on by 120

This formula was working fine... but has now stopped and i am unsure if its something i have done or what i am missing. Set(Loading_Screen2,true);

Set(FlowSuccess_CreateRecord,false);

Set(UniqueID,GUID());

If(EntryType_Dropdown.SelectedText.Value = "Tenant",

Set(FlowSuccess_CreateRecord,('FamiliarisationPDFTenants-ElectronicSig'.Run("",UniqueID,"","",Text( Today(), "[$-en-GB]mm/dd/yyyy"),Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),StationDropdown.Selected.Title,ManagerName.Text,ManagerEmployeeNo.Text,EntryType_Dropdown.SelectedText.Value,ManagerGrade.Text,"Subject",CurrentUser.Email,TenantName.Text,TenantLocation.Text,Tenant_email.Text))), Set(FlowSuccess_CreateRecord,('FamiliarisationPDFStationStaff-ElectronicSig'.Run(StaffEmployeeNo.Text,UniqueID,StaffNameInput.Selected.DisplayName,EmployeeGrade_Dropdown.SelectedText.Value,Text( Today(), "[$-en-GB]mm/dd/yyyy"),Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),StationDropdown.Selected.Title,ManagerName.Text,ManagerEmployeeNo.Text,EntryType_Dropdown.SelectedText.Value,ManagerGrade.Text,"Subject",CurrentUser.Email))));

 

I am now getting an error - "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app" Please help 🙂

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    @BenGillard 

    Change your formula to the following:

    Set(FlowSuccess_CreateRecord,false);
    
    Set(UniqueID,GUID());
    
    If(EntryType_Dropdown.SelectedText.Value = "Tenant",
     Set(FlowSuccess_CreateRecord,
     'FamiliarisationPDFTenants-ElectronicSig'.Run(
     "",
     UniqueID,
     "",
     "",
     Text( Today(), "[$-en-GB]mm/dd/yyyy"),
     Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),
     StationDropdown.Selected.Title,
     ManagerName.Text,
     ManagerEmployeeNo.Text,
     EntryType_Dropdown.SelectedText.Value,
     ManagerGrade.Text,
     "Subject",
     CurrentUser.Email,
     TenantName.Text,
     TenantLocation.Text,Tenant_email.Text
     ).Done="true" 
     ), 
    
     Set(FlowSuccess_CreateRecord,
     'FamiliarisationPDFStationStaff-ElectronicSig'.Run(
     StaffEmployeeNo.Text,
     UniqueID,
     StaffNameInput.Selected.DisplayName,
     EmployeeGrade_Dropdown.SelectedText.Value,
     Text( Today(), "[$-en-GB]mm/dd/yyyy"),
     Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),
     StationDropdown.Selected.Title,
     ManagerName.Text,
     ManagerEmployeeNo.Text,
     EntryType_Dropdown.SelectedText.Value,
     ManagerGrade.Text,
     "Subject",
     CurrentUser.Email
     ).Done="true" 
     )
    );
  • BenGillard Profile Picture
    120 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    I have amended the flow as you mentioned.. where would i add  .Done="true" to my formula?

     

    If(EntryType_Dropdown.SelectedText.Value = "Tenant",
    //Create Famil List Record and Create PDF and attach to List for Tenant
    Set(FlowSuccess_CreateRecord,('FamiliarisationPDFTenants-ElectronicSig'.Run("",UniqueID,"","",Text( Today(), "[$-en-GB]mm/dd/yyyy"),Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),StationDropdown.Selected.Title,ManagerName.Text,ManagerEmployeeNo.Text,EntryType_Dropdown.SelectedText.Value,ManagerGrade.Text,"Subject",CurrentUser.Email,TenantName.Text,TenantLocation.Text,Tenant_email.Text))),
    //Create Famil List Record and Create PDF and attach to List for Local Staff
    Set(FlowSuccess_CreateRecord,('FamiliarisationPDFStationStaff-ElectronicSig'.Run(StaffEmployeeNo.Text,UniqueID,StaffNameInput.Selected.DisplayName,EmployeeGrade_Dropdown.SelectedText.Value,Text( Today(), "[$-en-GB]mm/dd/yyyy"),Text( Today()+182, "[$-en-GB]mm/dd/yyyy"),StationDropdown.Selected.Title,ManagerName.Text,ManagerEmployeeNo.Text,EntryType_Dropdown.SelectedText.Value,ManagerGrade.Text,"Subject",CurrentUser.Email))))

     

    Thanks

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    @BenGillard 

    Yes, so that is going to return a table to PowerApps with no values in it.

    I would suggest adding a return value:

    RandyHayes_0-1602514432436.png

    NOTE: This return is a Text type with the text "true" in it.  Flow never seems to return the proper value with a boolean type for some reason.

     

    Now in your Formula you would just append this  .Done="true" to the Run function in your Set function.

     

    There are many ways to go about this, but this is one, and should work for you.

  • BenGillard Profile Picture
    120 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    It just had the basic...

     

    BenGillard_0-1602513644879.png

    What output do i need to add in order for it to work?

     

    Thanks

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    @BenGillard 

    What is your "Respond to PowerApps" block look like in your PowerAoutmate flow?

    Usually you will need to provide the parameter of the return.  Otherwise, PowerApps is trying to assign a Table to that variable that you declared as a boolean...this will be incompatible.

  • BenGillard Profile Picture
    120 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    BenGillard_0-1602513088316.png

     

  • BenGillard Profile Picture
    120 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    Hi,

    The run function previously was returning true (boleean) when it was succesfully as i have the respond to powerapps option added to the bottom of each flow.

    All i want is a way to start a loading screen when they click the button, and then a promt when the flow has returned a response so they know it ran succeffully.

    I am sure this was working 😞

  • timl Profile Picture
    34,939 Super User 2025 Season 1 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    Hi @BenGillard 

    The reason for this error will be because inconsistent data types are being stored in your variables. I would check carefully the places where you're setting your variables.

    Does the error message indicate exactly which variable this relates to?

    There are some more details in the post here..

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Context-Variable-Types-Are-Incompatible-Error-When-Setting/m-p/377083

     

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: "incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app"

    @BenGillard 

    So, in your Formula, you are setting the FlowSuccess_CreateRecord variable to true (a boolean) and then later setting it to the results of your Run fucntion.  What is run returning?  If it is not boolean, then PowerApps will not be able to evaluate and will consider them incompatible types.

     

    Also, if this is NOT the only formula that you are using to set the FlowSuccess_CreateRecord variable, then you need to look at all the places you set the variable and ensure that they are all being set to Boolean.

     

    I hope this is helpful for you.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard