How to change clone's props dynamically?

If I have some widget’s prop refering to another widgets value, like this :
image
it works fine.

But I would need to change dynamically some properties of a clone :
image
…doesn’t work :slightly_frowning_face:
What should be the correct syntax or method to achieve this ?

Maybe it’s better to think it the other way : have a script in my colorSelector widget that sets the clone’s props when its valu changes, but I can’t see how to do that…

clone set prop .json (5.3 KB)

Thanks in advance for your help :pray:

Clicking on “props” in the inspector will show the computed value for this property. The problem here is that the @{} block is replaced with the retrieved value, but it lacks the quotation marks

{
  "colorWidget": red
}

Should be:

{
  "colorWidget": "red"
}

Two ways to avoid that: enquote the @{} block, or define the props property with a JS block:

JS{{
return {
  colorWidget: @{widget_id}
}
}}

In this context, @{} blocks are seen as javascript variables (where a string is enquoted automatically).

Sidenote: writing @{widget_id} is the same as writing @{widget_id.value}

Thank you !

I never think to look at inspector’s “computed value”… very useful, thanks for the reminder :+1: