I have this strange behavior inside the TEAMS Power Apps editor that I cannot understand. I have the following simple setup (with code directly from Microsoft). I basically want to set a global variable with SET() and then I would like to change some data in the global variable using SET() and PATCH() together. When I first add the object (a button) and enter the code, no issues. It works fine. But when I restart the app, the PATCH() function shows an error (Incompatible type).
I have a button with ONSELECT:
Set( Person, { Name: "Milton", Address: "1 Main St" } )
I have another button with ONSELECT:
Set( Person, Patch( Person, {Address: "2 Main St" } ) )
As said, it works fine at start, but if I restart the app both buttons show an error. "Incompatible type". The code elements are taken from Microsoft own examples (SET FUNCTION).