cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

 

Spoiler
"The types of the specified context variables are incompatible with the types specified elsewhere"

Hi All - I suddenly cannot navigate to ANY form in ANY app where context variables are being passed. This has started to err on ALL of my apps!

 

NO exaggeration to say I cannot support live apps right now after having waded through tens of 'yellow error triangles' in one app for quite some time only to see them disappear without having made any changes! Said app is now working but the others have started to err as well.

 

I found a similar thread and posted a reply there but I feel this warrants an urgent resolution AND the cause unrelated so I started new thread here!

https://powerusers.microsoft.com/t5/PowerApps-Forum/service-desk-template-errors-in-filter/m-p/47345...

 

(session ID below)

 

Session ID: c29acddf-9a17-5584-23f6-92ace3b9e215

 

 

23 REPLIES 23

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

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

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. 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (37,007)