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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

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 (9,758)