Forum Discussion
PowerBI Visuals API updating issue
- 10 months ago
Hi TheoAu ,
As the Troubleshooting steps didn't helped in solving the issue, I would suggest to raise support ticket using Microsoft's official support ticket channel using below link:
Create a Fabric and Power BI Support Ticket - Power BI | Microsoft Learn
Thank you.
Hi TheoAu ,
fetchMoreData() won’t trigger update() - that call only happens when Power BI signals a data or layout change.
To make your visual refresh automatically, add a visibility or resize listener inside your constructor (not a Power BI API, but standard browser APIs):
Use IntersectionObserver or window.addEventListener("resize", ...) to detect when the visual becomes visible again.When triggered, call your internal render logic (the same code you use in update()) to redraw the visual.
This ensures your visual refreshes when switching report pages without user action, even though update() isn’t called.
Thank you.
Hi, thank you for your answer.
When I (re)load the page, the visual is both constructed and the update(options) function is called with the VisualUpdateOptions in params.
However, when I switch pages and return to the visual, the visual is reconstructed, but the update(options) function is not called. I could force a call with a listener or the examples you provided, but it seems that I do not have a solution to pass the VisualUpdateOptions as parameters if the update(options) function is called for the first time.
Here is an example with a logger:
Initial visual loading - On this screenshot, we can see that both the constructor and the update(options) are called.
When switching page - On this screenshot, only the constructor is called. I could force the update function but I do not have any VisualUpdateOptions object in the constructor.
Having a VisualUpdateOptions object passed to the update function is necessary to make my visual having data inside.
Do you know if any solution exists for now?