Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Is it possible to trigger the update method from the constructor?

Is it possible to trigger the update method from the constructor?

if so - how?

 

greetings

phil

1 REPLY 1
dm-p
Super User
Super User

Hi @Anonymous,

I imagine that you could invoke this.update() in the constructor, but you'd need to pass a valid VisualUpdateOptions object, which is only supplied and triggered from the visual host/main window.

If your visual contains data in the data view when it is initialised, it will run both methods according to the system integration diagram.

Perhaps if you could clarify your use case for why you want to do this, we might be able to advise further.

If it's about wanting to execute both constructor and update methods when the visual is first initalised, irrespecitve of whether there's data in the data view, the correct way to do it would be to enable the landing page APIs, which will cause Power BI to execute both methods in this manner. You could then handle the empty data view or route your visual logic accordingly.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors