web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unstable code... works...
Power Apps
Answered

Unstable code... works one week fails the next (without changing anything!)

(0) ShareShare
ReportReport
Posted on by 375

Hi,

There are a few old posts on the stability of PowerApp (canvas) code but none quite seem to match the stability issues we are having.

 

Situation.

To reduce reinventing the wheel every time we build a new canvas app we have built an app to use as a template. This references a number of tables to hold settings and app information. These tables will need to be recreated for each new app as the settings tables must only contain information relevant to the app. In Dataverse we use a new Solution and dedicated publisher to provide unique prefixes for the tables. The template can also be used with other data storage e.g. Azure SQL, SharePoint Lists, etc.

 

Within the template there are over 100 references to the tables (each setting can be managed separately).

Using find and replace each time you need to change the table name is messy and time consuming. To over come this I've created a Global Variable to hold the table names and assign these to values that are used throughout the app.

 

The code to set the variables looks like this (runs on App.OnStart):

Set(
glbUseTable,
{
settings: settingsTable,
images: imagesTable,
permissions: permissionsTable,
users: usersTable
}
);

 

The tables are then referenced through the app like this:

ClearCollect(
colSettings,
glbUseTable.settings
);

 

This worked perfectly until last week (w/c 03 Jul 2023) and then without any reason it failed and I had to revert back to calling the tables directly. What is really frustrating is that within the same app the original code worked in some places and not others, and the areas where it worked varied each time the app was opened to edit it.

 

Even more bizarrely, the code is now randomly deciding what table column name to use.

Originally, this worked fine: 

LookUp(
    colSiteImages,
    imagelocation = "HomeScreen"
).image

 

In some places I now have to change it to this (and use the publisher prefix for the columns):

LookUp(
    colSiteImages,
    uma_imagelocation = "HomeScreen"
).uma_image 

 

In other places in the same app it refuses to pull information from the collection and ends up with a mix of both prefixed and friendly names to work.

LookUp(
    uma_siteImages,
    imageLocation = "HomeScreen"
).uma_image

 

Any one else finding these problems and if so have you managed to resolve it and how?

 

Thanks in advance.

 

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,393 Super User 2025 Season 2 on at

    Hi @Gary_Eden 

    The most likely cause of this problem is that 'explicit column selection' is enabled in your app. At the time at which you call ClearCollect, Power Apps cannot determine the columns that you require later in the app (when you call LookUp), so it fails to retrieve your required columns.

    To resolve this, I'd investigate modifying your app to use named formulas instead of collections. This would provide an alternate way for you to 'alias' table names based on different data sources.

    https://powerapps.microsoft.com/en-us/blog/power-fx-introducing-named-formulas/


    The alternate quick fix is to disable 'explicit column selection' in the app settings, however this would have a much more severe negative impact on performance.

     

  • Gary_Eden Profile Picture
    375 on at

    Hi @timl 

    Thanks for the information, I'll look into using named formulas (thanks for the link), I haven't come across this before.

     

    Regarding disabling the 'explicit column selection', now I know what to look for it makes more sense. However, the ability to turn this off is available within standard PowerApps but not in PowerApps 4 Teams - my template must be useable in both environments.

     

    Reading the other threads on 'explicit column selection' there was an indication that once out of preview this would become the default and you wouldn't be able to turn it off (hence named formulas will be the way to go).

     

    Looking at my app history in teams it looks like this mandatory application of 'explicit column selection' came in with PowerApps release 3.23064.16 or 3.23071.11. The previous version 3.23063.15 worked fine.

     

    Thanks again Microsoft for 'fixing' what wasn't broken.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard