Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Is it possible to trigger the update method from the constructor?
if so - how?
greetings
phil
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
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 2 | |
| 2 | |
| 2 |