Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Can Apps corrupt to cause Unrecoverable Incompatible Type errors

So I use context variables on screens that are loaded with data from a sharepoint list, normally when the screen is navigated to.


Navigate(MyScreen, Fade, {varMode: "View", varRecord: LookUp(MyList, ID=ThisItem.ID)})

I then update the variable in the OnChange box of whatever control it is that I am using, making sure I use Text or Value to define the type as I have been bitten in the past by Incompatible Type.


UpdateContext({varRecord: Patch(varRecord, {Title: Text(Self.Text)})})

I have done this many times and have many apps that use this method at there core.


What I have found, it that in some apps, when I get Incompatible Type Error, there is nothing that I can do to get rid of it. I know that all of the data types are matching and if I use the same code and data in another app it works as intended. However if I copy controls over, or save it at something else or create a new copy based on an export/import it seems to follow.


Can someone point me at what to read to get a better understanding of why this happens? Its just happened to me again as I am nearing the end of the App and now I have to redo whole chunks of it using code I have used hundreds of times before with no issues.


Frustrated from the NHS

Super User
Super User

Hi @DaveTaylorNHS ,


Only thing that comes to mind is perhaps you are using the same variable with a different data schedule within the same context.

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Frequent Visitor


Thank you for replying, I am not sure what you mean by data schedule, perhaps you could elaborate. The only definition happening to the variable are all based on an update to an individual item in the record or its initial definition based on a looked up record.




Super User
Super User

Hi @DaveTaylorNHS,


I meant data scheme: how your data is structured, column names, data types, etc. Looking from you screenshot I don't see anything obviously out of the ordinary, but I don't know the details of your data source.


When trying to replicate the issue, I didn't run into any issues, so can you please share the exact error message you are getting?

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Frequent Visitor

So the Exact Error Message is the normal Incompatible type, which then causes errors in anything referencing or related to the variable in question.


I have now resolved my issue by going line by line and rebuilding from nothing, putting each call in one at a time until I got an error. As the error only appears on a program load, this was a lot of saving and opening over the course of the weekend. 


I did find a control that was being referenced without the 'required' TEXT function around it and that I thought that was it.


However, my app makes a lot of related calls e.g. you have Incidents and they may have actions against them, but you could also have an action related to something else. To manage the UI, I store what calls the screen so that I can navigate back. This means more than one call defining the same context variable based on the same data source and as soon as I started putting them back in, I started getting the error again.


I recall seeing another article saying you should define the variable in OnStart, so I converted all my variable calls to Global Variables, rather than context, and defined them in OnStart with a Blank(). This also worked for a bit until I started re-introducing the code that was in my OnVisible, which basically put an update on on a new record that you did not worry about in the UI, e.g. ID of the routine creating the action.


Changing my OnStart Definitions to base it on the record I wanted e.g. Lookup(datasource, ID=-1) fixed this, though I only need to do that one the variables that did things OnVisible.


It was a total chore working through all the iterations and extremely frustrating, but I stuck with it as I knew it should work.


I can duplicate the fault and if I had the time I would log it with Microsoft, but to be honest after three days of shouting and swearing at PowerApps, I have given up the will for this particular issue.


So thank you @BCBuizer  for the assist and anyone else working through Incompatible Type then my advice is stick with it and check one thing at a time. Also, when you make a lot of definition changes to a variable then after you have saved it, open the app again, just to make sure it likes it.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,675)