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

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.

Reply
pramodx
New Member

persistProperties

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.

1 REPLY 1
dm-p
Super User
Super User

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





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

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)




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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