Perspective Set Property Persistence via Script

Is there any way to set a property’s persistence via a script? I have a script that will add a custom array property to a component. I’d like to be able to change it via the script to not persist so that it is forced to initialize each time and doesn’t save with the view if I’m testing it in a Designer session.

Ignition 8.1.5

Why don’t you apply the property in the Designer and just set it to not be persistent? It doesn’t sound like you need to dynamically set the persistence capabilities; it sounds like you just always want the property to not be persistent.

But doesn’t that cause the property to disappear when I close the designer, not just the value? I thought I had tried that already but I’ll try again.

You won’t see the property any longer, but the it’s still in the schema with persistence = false, which is why you don’t see it.

If you need to property to exist for bindings or some other reason, then there’s nothing you can do here; there’s no way to toggle persistence outside the Designer UI.

1 Like

Oh perfect. I must have done something wrong the first time I tested this. The persistence property came back true after initially setting it to false, but maybe I forgot to save or something. I’m seeing the proper behavior now. Thanks!

1 Like