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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors