Forum Discussion
danieleperilli
4 years agoKudo Commander
host.persistProperties with data bound properties
Hi everyone, I have 2 different problems with the host.persistProperties method with data bound properties. I'm perfectly able to use it with static properties. 1. When the property is bound ...
Anonymous
4 years agoNot applicable
Hi danieleperilli ,
From the offical blog: VisualConstructorOptions
persistProperties, allows users to create persistent settings and save them along with the visual definition, so they're available on the next reload
You can look for an example in powerbi-visuals-sankey custom visual, where it is used to store various properties.
A rough example for your case:
options.host.persistProperties({
VisualObjectInstance = {
objectName: "filterSetting",
selector: undefined,
properties: {
filter: "xyz"
}
};
});
After triggering the persistProperties function, the visual triggers an update, populating the VisualUpdateOptions' options.dataViews.metadata.objects with the persisted property. Note, that you have to define your property in the capabilities.json beforehand.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.