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

Bug with global variable

Hi everyone,

 

I just posted this bug report in Sudden err but no dev changes made 'Types of the specified context variables are incompatible.....' and I don't know why it got rejected. Maybe it was because the thread was old? So I'll open a new one. If something is wrong with this post, please tell me what it is.

 

 

 

All of a sudden, I experienced a bug with global variables. Context Variables are not (yet) effected.

 

The functions where I used a global variable don't work anymore. Error messages state either: "Function 'xy' has invalid arguments/parameters." or: "invalid argument type" or: "The types of the specified context variables are incompatible with the types specified elsewhere".

 

The last error message (types incompatible) only appears within the Set() functions. After I removed all but one Set functions (I had only three), this error disappeared at the remaining Set function. But even then every other error stays.

 

Via the PA web interface, I restored an older version of my app from 2 weeks ago. I know for sure, that everything was working just fine there and no error appeared when I built this old version. Also until today everything worked fine. But since today with the current version as well as with the old version the global variable doesn't work anymore.

 

Even more strange: Everyone still can use the app without errors. Also the forms etc. affected by the errors work just fine. The errors only appear within the development mode (and preview mode). I still can use the app normally on my Android Smartphone. It also works just fine at my own Windows 10 PC and at the PC of one of my colleagues. The currently published version was made between the 2 weeks old one and the current one. And I also tested to restore this version, of course, but the same errors appeared.

I even changed the Live version today, before the errors came up. Also the last Live version before that worked normal.

 

 

I use this global variable to bind one of several data sources (Excel tables) to different forms at runtime. So the users can chose between different news channels to read or write news. To chose between different data sources I included a dropdown menu with the following relevant functions:

OnChange: 

Switch(
    Dropdown2.Selected.Value;
    "A-News"; Set(SelectedNewsSource; News_A);
    "B News"; Set(SelectedNewsSource; News_B);
    Set(SelectedNewsSource; News_A)
);;

Items:  

["A-News"; "B News"]

"News_A" and "News_B" are the data sources (Excel tables on OneDrive for Business).

 

 

Every form and element which refers to this data instead refers to the global Variable SelectedNewsSource (at least indirectly via a reference to the corresponding BrowseGallery).

 

 

I believe there must be a bug in PA, as the errors now come up even in older versions. The PowerApps Release / Version didn't change over the last three weeks. Based on the version overview for my App the PA version is 2.0.730.

 

It would be really nice if one could solve the problem. If you need more information I'll try to provide them.

 

Best Regards,

Roberto

10 REPLIES 10
Highlighted

I just had this bug happen to me and it's very clear. If you first assign a Global variable to one data type and then change that data type you will definitely get this error. "Assessment" is a SharePoint list and originally it was a Choice field and then I changed it to a Single Line of text. The fix was simply to rename the variable to "varCurrentQuarter" from "varQuarter". So somewhere inside PA's is typing this variable and not letting you change it.

GLobalVariableBug.jpg

 

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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