Hi everyone,
I'm working on a Figma plugin using variables, and I've encountered an issue with variable binding information on instances. Here's my situation:
-
For a component (the main/original component) that has its
characters
property bound to a string variable, I can successfully retrieve the binding details. For example, using:node.boundVariables['characters']
returns an object with binding information (including the variable alias).- Then, using
await figma.variables.getVariableByIdAsync(variableId)
, I can get the variable details (and see avariableDetails
structure, including the variable ID and mode-specific values).
-
However, when I create an instance of that component and bind its
characters
property to a variable, the resulting instance'scharacters
property resolves to the overridden string value (e.g., "Share Link Open") and theboundVariables
object does not include a key for"characters"
. In other words, I cannot see the variable binding details (or the variable ID) for the instance'scharacters
.
My questions are:
- Is my understanding correct that, while the original component exposes its variable binding details (via
boundVariables["characters"]
and itsvariableDetails
), an instance does not expose this information? - If so, is there any method or workaround available to retrieve the bound variable ID (and its mode-specific values) for the
characters
property on an instance? I need to know which variable from the local variables collection is bound to the instance'scharacters
, since I can't simply refer to the mainComponent's binding (they can differ).
Any insights or suggestions would be greatly appreciated!
Thanks in advance.