The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone,
I am currently developing a custom Power BI visual, specifically a toggle with an interface rendered entirely in my visual. This toggle does not use any data fields from Power BI, nor do I use the default Microsoft toggle interface. The goal is that the toggle can be toggled (on/off) directly in the visual and its state (on/off) is saved using the Power BI bookmark feature.
The problem I am facing is:
How can I save the on/off state of the toggle in my custom visual via bookmarks without relying on data or data fields?
Is there a way to integrate my custom visual with the Power BI bookmark API to capture the UI state?
If so, what methods or configurations do I need to implement in the visual's source code to support this feature?
I have consulted the bookmark documentation on Microsoft Learn and some articles on custom visuals, but have not found specific instructions for the case of not using data but only saving interface state. Does anyone have any experience or examples related to integrating bookmarks with custom visuals? If there is sample code or detailed instructions, I would love to refer to it.
Thank you very much everyone!
Solved! Go to Solution.
Hi @DavidAnthony,
Thank you for Using Microsoft Fabric Community Forum.
To save the toggle state (on/off) in your custom Power BI visual using bookmarks without relying on data fields, you can use persistProperties and enumerateObjectInstances in your visual’s source code.
When the visual’s toggle is switched, the state is persisted in the visual’s object model. When a bookmark is created, Power BI captures this state. Restoring the bookmark restores the toggle’s UI state.
I hope this helps you build intuitive and bookmark-friendly toggles in your Power BI custom visuals!
This link explains how to use the persistProperties method to save and restore visual settings, which is essential for maintaining UI state across sessions and bookmarks.
Visual API for Power BI Visuals - Power BI | Microsoft Learn
This link says how custom visuals can support bookmarks by correctly saving and retrieving the necessary information when required.
Add bookmark support for Power BI custom visuals - Power BI | Microsoft Learn
Below are some resolved issues related to the use of persistProperties that you may refer to, they might help:
Solved: Power BI Custom Visual state persistence - Microsoft Fabric Community
Solved: persistProperties and stored data persistency - Microsoft Fabric Community
I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.
Best regards,
Sahasra
Community Support Team.
Hi @DavidAnthony,
There is no support for bookmarks in custom visuals. I've been asking for several years without success in getting this progressed.
As mentioned elsewhere, you can have an element on your visual that persists and reads properties to the visual objects via the persistProperties API. However, this is scoped to your visual and requires data to be present, so it's not what you want.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Thanks for your reply
Hi @DavidAnthony,
Thank you for Using Microsoft Fabric Community Forum.
To save the toggle state (on/off) in your custom Power BI visual using bookmarks without relying on data fields, you can use persistProperties and enumerateObjectInstances in your visual’s source code.
When the visual’s toggle is switched, the state is persisted in the visual’s object model. When a bookmark is created, Power BI captures this state. Restoring the bookmark restores the toggle’s UI state.
I hope this helps you build intuitive and bookmark-friendly toggles in your Power BI custom visuals!
This link explains how to use the persistProperties method to save and restore visual settings, which is essential for maintaining UI state across sessions and bookmarks.
Visual API for Power BI Visuals - Power BI | Microsoft Learn
This link says how custom visuals can support bookmarks by correctly saving and retrieving the necessary information when required.
Add bookmark support for Power BI custom visuals - Power BI | Microsoft Learn
Below are some resolved issues related to the use of persistProperties that you may refer to, they might help:
Solved: Power BI Custom Visual state persistence - Microsoft Fabric Community
Solved: persistProperties and stored data persistency - Microsoft Fabric Community
I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.
Best regards,
Sahasra
Community Support Team.
Thanks for your reply
Hi @DavidAnthony,
Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you.
Hi @DavidAnthony,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
Thank oyu for using Microsoft Fabric Community Forum.
Hi @DavidAnthony,
We wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If my answer resolved your query, please mark it as "Accept Answer" and give Kudos if it was helpful.
If you need any further assistance, feel free to reach out.
Thank you for being a valued member of the Microsoft Fabric Community Forum!
User | Count |
---|---|
5 | |
3 | |
3 | |
2 | |
1 |
User | Count |
---|---|
11 | |
7 | |
4 | |
4 | |
4 |