cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
weihu1
Frequent Visitor

UpdateContext function inside OnChange is inconsistently happening

Hello, 

 

Question about an UpdateContext function inside an OnChange.

 

In this situation, there is one label, two dropdowns, and one textbox.

weihu1_0-1622729292828.png

 

 

The label ('In Specifications')'s text is changing based on an UpdateContext function, which triggers in the OnChange of both dropdowns ('Dimensional Callout #'/'Location'). The textbox ('Dimensional Value') dictates the condition/result of the text and color: Yes if the Dimensional Value is in the range depicted, No if outside of the range. 

 

The label's text is changing correctly most of the time, but it will not change correctly randomly and displays incorrect values to the user.

 

Before dismissing it as an intermittent Powerapps bug, has anyone seen this before? If it is a Powerapps bug, does anyone have an explanation of the reason it is happening?

 

Further explanation can be given if not clear. Thank you in advance.

5 REPLIES 5
C-Papa
Super User
Super User

Hi, for the property that is not changing correctly, add Reset(ControlNameNotChanging) to the onchange property of the dropdown, where ControlNameNotChanging is your label name

weihu1
Frequent Visitor

Hello, 

 

Thank you for the reply. Powerapps says labels are not resettable controls. 

weihu1_0-1622730841166.png

 

C-Papa
Super User
Super User

Ok, sorry, that was my fault. Rather than using UpdateContext() try using Set() for example, Set(var_selected,Dropdown1.Selected.Value) and use var_selected in the same place you are using the updatecontext field

weihu1
Frequent Visitor

Hello, 

 

Thank you for the reply. We were using Set before UpdateContext and there were a lot of issues with the label updating correctly. After making the switch to UpdateContext from the advice from another forum post, we ran into fewer issues and more consistent displaying of correct values. However, inconsistencies still occur and we are looking for a solution or explanation of its root cause.

weihu1
Frequent Visitor

Hello, 

 

The randomness is the main issue, since it is occurring occasionally without any code changes and noticeable patterns. Any suggestions are appreciated. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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