How to change the content of a text property of an instance

I’m a novice in plugin development, so the question is very basic: if a component has a property (type=“TEXT”), how can I change its value for the selected instance?

You need to use the setProperties(obj) method.

InstanceNode.setProperties({'propertyName': 'propertyValue'});

[quote="tank666, post:2Thank you for answering. I tried that but there is a strange error: “Could not find a component property with name: ‘Text’”. However, there is such a property in this instance

propertyName corresponds to the names returned by componentPropertyDefinitions and should be suffixed with ‘#’ and a unique ID for ‘TEXT’, ‘BOOLEAN’, and ‘INSTANCE_SWAP’ properties.
InstanceNode | Plugin API

2 Likes

That worked, great!
I found the property: console.log(element.componentPropertyDefinitions); and indicated the property name. Thank you very much!

1 Like