Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

updateView is not called on every attribute change?

(0) ShareShare
ReportReport
Posted on by 48

Hello- 

I observed a somewhat unexpected behavior. Per documentation: https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/control/updateview : 

"This method will be called when any value in the property bag has changed. This includes field values". However, it seems the runtime is throttling/staging calls, and skip some calls within a timewindow. 

I have a PCF bound to a field. In my form script, I have code

var myAttr = formContext.getAttribute('myfield');
myAttr.setValue("1");
myAttr.fireOnChange();
myAttr.setValue("2");
myAttr.fireOnChange();
myAttr.setValue("3");
myAttr.fireOnChange();

Then in my PCF I logged the attribute value inside updateView function. 

I was expecting that I see all three values per control, because the fireOnChange should invoke all registered controls that bounded to the field and call the updateView. 

 

I am only getting the value 3, but not 1 or 2. 

 

That seems suggest the runtime somehow stage the call within a timewindow, and only invoke the last one and cancel previous ones. It's not uncommon to do this for performance reasons, but it does impact how client should write code if it is by design. 

 

Anyone from PCF team can comment on that?

 

Thanks!

 

 

 

  • liun Profile Picture
    48 on at
    Re: updateView is not called on every attribute change?

    @jolake Thank you. It will be nice if the documetation can reflect that as well.

  • ScottDurow Profile Picture
    1,039 on at
    Re: updateView is not called on every attribute change?

    Great - I think this is pretty clear and makes total logical sense to me.

  • Verified answer
    jolake Profile Picture
    on at
    Re: updateView is not called on every attribute change?

    PCF will only call updateView when the backing data layer tells us there is new data for our property bag. Unfortunately, due to batching that occurs for updates of the data layer, if you do several changes like this in rapid succession they will likely end up batched, and thus your control may only get an updateView for some of the calls. This is by design, but you can be confident that whatever value PCF recieves will the most recent value.

  • ScottDurow Profile Picture
    1,039 on at
    Re: updateView is not called on every attribute change?

    Bump!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 55 Super User 2025 Season 1

Overall leaderboard