How do i change instance property with the setProperty function?

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)?

Most likely you mean setProperties(obj).

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

Yes yes.

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

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?