Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I am new to custom visual development and therefore this query.
I have developed a simple custom slicer that, as expected, filters data based on checkbox selections. I am saving the selection state using persistProperties method but on saving the report or reloading, I lose the saved state and instead the last saved state is loaded. What might I be doing wrong here? The state persistence works fine as long as I am navigating within the report.
Any pointers on implementing persistProperties and why I am losing the state on save, would be appreciated.
Hi @pramodx,
It's not clear how you've set up your properties from the details in your question, but using persistProperties is not ideal in this case - for visuals that intend to function as a slicer, use the Visual Filters API and the approaches documented in this page to persist and restore selection state. Power BI will do a lot of the work for you and you then just need to manage the UI handling of restoring selected values from the update options' jsonFilters array into your elements.
If you're using this approach and using persistProperties for some other aspect of your visual's logic, then please share some details of your code, as well as your visual's capabilities, as it's very hard to debug these problems without having this context.
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
7 | |
2 | |
1 | |
1 | |
1 |