Forum Discussion

alexpokerface's avatar
alexpokerface
Frequent Visitor
7 months ago
Solved

persistProperties no longer persists unless property is changed via Formatting Pane

Hi everyone, I’m seeing unexpected behavior with host.persistProperties() in a custom visual using the new formatting model (getFormattingModel). Since late 2025 / early 2026, properties set program...
  • dm-p's avatar
    7 months ago

    Hi alexpokerface,

     

    What value are you using for selector in the persist operation? I used to use undefined prior to moving to the formatting model, but I was having the same issues and had to change this to be explcitly null to persist correctly. This is technically the correct syntax for the data view if a property is unbound, and I suspect that the enumerateObjectInstances() method was a bit more forgiving.

     

    Depending on your TS configuration, you may need to cast to keep the compiler happy, e.g.:

     

    {
      replace: [
        {
          objectName: "myObject",
          selector: null as unknown as powerbi.data.Selector,
          properties: {
            // Property value(s)
          }
        }
      ]
    }

     

    Hopefully this helps. Good luck!

     

    Daniel