cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Studio Bug: Controls not updating

Please see the discrepancy between the formula bar evaluation of the formula and label text in the image below.

The CountRows should return 0 which is correctly shown in the formula bar evaluation (text returned is 'None 0') but is not showing correctly in the label (displayed text is 'None 2' - there were originally two items in the gallery but when they were removed, the text in the label did not update).

If I modify the formula (say, delete the end parenthesis and then add it in again) the label will then show the correct value, but changing the number of items in the underlying gallery does not update the value in the label. It appears formulas in controls are not recalculating automatically, only when they are forced by directly modifying the formula using the formula bar.

 

image.png

This is a common but intermittent fault (I have seen it many times in different Apps but it does not always occur).

 

4 REPLIES 4
Super User III
Super User III

Thanks @PaulD1 ,

I answered a post recently where a HTML box with elements based on a gallery value was not updating, even when the data source it contained was refreshed. This could be the reason (though not the solution)

Community Support
Community Support

Hi @PaulD1 ,

Do you mean that the Label control could not updated dynamically?

How do you remove the items from your Gallery? Using Remove function or remove items manually from your data source manually?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The Label control displays correct value when I remove items from the Gallery.

 

Please consider refresh your data source using Refresh() function when you remove items from your canvas app. Then add a new Label in your app, try above formula again, check if the issue is solved.

 

In addition, as an fixed solution, you could also consider type the following formula after the Remove() function:

Remove(....);
Set(CurrentAmount, CountRows(galTheNewMilestone_scrnAddNewProject.AllItems))  // Save this value into a variable

then bind the variable to your Label control, check if the same issue still occurs.

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-xida-msft 

Yes, the label control is not updating dynamically.

I have seen this numerous times in Studio particularly as Apps get larger.

The Apps behave correctly in the Web Player but not in Preview mode in Studio. Closing/restarting Studio will usually resolve, but it is very annoying and causes wasted time as we investigate 'bugs' that turn out not to be in our code but in the way the Studio behaves.

In this case the gallery is based on a local collection and the Patch/Remove function is being used add/delete records.

The number of records was being used to determine if certain controls should be visible - when I saw this was not working correctly I added the CountRows to the text property of the label so I could see more clearly the result of the formula.

Hi @PaulD1 ,

Thanks for your feedback. Currently, I could not reproduce your issue on my side.

 

If you would like to get further help in this issue, please consider submit an assisted support ticket through the following link:
https://powerapps.microsoft.com/en-us/support/pro

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (55,304)