Skip to main content

Notifications

Community site session details

Community site session details

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

UpdateView not being called as it should with react

(0) ShareShare
ReportReport
Posted on by

Hey all,

 

I'm having problems for a week now, and I hope you guys can help me. 

 

I'm creating a PCF with react that renders a component with one DefaultButton and two Dropdowns from FluentUI. When clicked, the onClick of the DefaultButton calls the context.device.pickFile() method for a user to choose a .xlsx file, and another method is called (readExcel()) to read the file and get the name of the columns as the Dropdown options, updating 2 useStates created to hold the IDropdownOptions.  I was expecting that the component and the updateView would re-render, but for some reason, the updateView is not being called, even when i call notifyoutputchanged() as a prop from the readExcel() method.

 

The component and the control are only updated when I click the DefaultButton again (and don't choose any file, clicking "cancel"), only then the Dropdown options are showed.

 

I also tried to call the context.factory.requestRender() method to force the updateView to act at the end of the readExcel() method, but not even calling it I was able to make the control update automatically after choosing the excel file, I always have to click the DefaultButton for the options in the Dropdown to appear. 

 

Has anyone already experienced something like that? Does anyone have an Idea about how to solve this problem?

 

Thank you so much!

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: UpdateView not being called as it should with react

    Hi @DPADPA , 

     

    The updateView is called by the platform if the property changes. 
    You are right about  the need to call notifyOutputChanged(). If you do that, the platform will call the getOutputs() method, where you can provide the new values for your properties. Maybe in your case the value of the property is not a new one, so maybe that's why the platfororm doesn't detect a need to call the updateView.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 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…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard