cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

9 REPLIES 9
Highlighted
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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted
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...

 

Highlighted

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 😞

Highlighted

BenGillard_0-1602513088316.png

 

Highlighted

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

It just had the basic...

 

BenGillard_0-1602513644879.png

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

 

Thanks

Highlighted

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

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

Highlighted

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,778)