cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Power Apps
Power Apps

Re: Sudden err but no dev changes made 'Types of the specified context variables are incompatible...

Hi,

Both with context variables(which are scoped to screens) and global variables, the definition merging algorithm is the same. If you have multiple definitions for the variable, we try to merge their data types(the merge succeedes only if the differing definitions are table or record type and have distinct types for distinct columns).

For example:

correct usage -

Definition1: UpdateContext({var:{column1:true, column2:45}})

Definition2: UpdateContext({var:{column3:"Name Field", column4:{x:true, y:3}}})

the end result will have the type of variable 'var' = :{column1:boolean, column2:number,column3:text, column4:{x:boolean, y:number}}

 

Erroneous usage -

Definition1: UpdateContext({var:{column1:true, column2:45}})

Definition2: UpdateContext({var:{column1:"Name Field}})

Here you have deined column1 as both a boolean and a text which cannot be auto resolved. This will result in error showing up on the definition as well as all the usages.

 

The same is true for Set function usage. You can go to View -> Variables(experimental) and see all the places you have defined the variables and confirm that the types you are passing are compatible.

 

Thanks,

_hemanth

 

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: Sudden err but no dev changes made 'Types of the specified context variables are incompatible...

I had the same problem but magically it was solved and now I have it again ...
the performance of powerapps lately leaves much to be desired ... from now on we hope that they give some report on how they are going to solve these SERIOUS problems

Highlighted
Advocate I
Advocate I

Re: Sudden err but no dev changes made 'Types of the specified context variables are incompatible...

Same error.

Specifically with the Set variable.

I can temporarily fix this by copying all of my definition code out of the places they appear in the app. This of course breaks anything that is referencing the object.

I copy all these into a notepad document and indicate where they belong. 

After I have done this, I then begin placing the definitions back in one at a time. 

Magically all the errors go away. I want to reinforce that I changed noting while copying them out of the app and pasting them back in. Everything is exactly the same.

PowerApps needs to add a way to force the "compiler" to reassess all of the difined objects and their uses. 

Highlighted
Frequent Visitor

Re: Sudden err but no dev changes made 'Types of the specified context variables are incompatible...

Apologies for resurrecting an old thread but I am only posting this solution in case someone comes accross the same issue.

 

This morning I encountered this error ("Types of the specified context variables are incompatible...") whereas my code/app was working last night and no code change was made between last night and this morning.

 

I spent some time trying to resolve the problem; I tried several time-consuming tricks (inc. this one: https://www.itaintboring.com/powerapps/canvas-app-incompatible-variable-types/).

 

However, I just managed to fix this by clearing the browser cache (I use Chrome: https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en).

 

As soon as I cleared the cache and reloaded Power Apps studio, the error was gone.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,516)