Skip to main content
Question

How do i change instance property with the setProperty function?

  • December 1, 2022
  • 3 replies
  • 854 views

Daniel_Kalman

I’m trying to set the instance property by calling
setProperty({Icon#46:0 : 'key of desired instance'})
but i get
Property value is incompatible with component property type

Is there anything different with setProperty when you swap instances (instead of a boolean or variants)?

This topic has been closed for comments

3 replies

tank666
  • 4868 replies
  • December 1, 2022

Most likely you mean setProperties(obj).

Are you sure the “Icon#46:0” property is of type “INSTANCE_SWAP”?


Daniel_Kalman

Yes yes.

Turns out you need to pass id instead of key here. Took me a minute


Domenico_Flauto1

Hey @Daniel_Kalman how did you solve this?

I am trying to change instance of a property (same as screenshot below) to one of preferred values, but can’t find the right syntax anywhere. I am trying

instance.setProperties({
  ["Icon#1512:2"]: "key or id or name"
})

but I am also getting Error: in setProperties: Property value is incompatible with component property type

tried id, but maybe I am not getting it right? how do I get the id of the preferred values?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings