cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenGillard
Helper III
Helper III

"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"

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

@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"        
    )
);
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

9 REPLIES 9
RandyHayes
Super User III
Super User III

@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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
timl
Super User III
Super User III

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-Erro...

 

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 😞

BenGillard_0-1602513088316.png

 

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It just had the basic...

 

BenGillard_0-1602513644879.png

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

 

Thanks

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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

@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"        
    )
);
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,846)