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 programmatically are not persisted across visual reloads (F5) unless the same property has been modified at least once through the Formatting Pane UI.

What I observe:

  • The card, group, and slice are all visible in the Formatting Pane

  • The property is correctly defined in capabilities.json

  • If I change the value in the Formatting Pane → it persists across reloads

  • If I set the value via persistProperties → it only lasts until the next reload

  • Other cards that contain UI‑controlled properties persist correctly, so this seems tied to whether the card is considered “active” by the new formatting engine

It looks like cards without a user‑edited property are no longer treated as persistable, even if they are visible and have slices.

Has anyone else run into this, or found a reliable way to make a card persistable without requiring the user to manually edit a property in the Formatting Pane?

Thanks,

Alex

  • 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

2 Replies

  • 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

    • alexpokerface's avatar
      alexpokerface
      Frequent Visitor

      Hi  dm-p ,

      Thanks a lot for your suggestion! The selector was indeed the problem. I used {} instead of null or undefined in some cases. For me now it works with both null as well as undefined.

      I remember I couldn't get it to work with undefined or null before and had to use {} instead. But I have tried a lot since then, including changing the data type of the data to persist from numeric to string. That in combination with the undefined selector seems to work now.

      Thanks again and kind regards,

      Alex