Skip to main content

I’m trying to retrieve the variable ids bounded to a text layer so I can use theirs names for documentation. I’m successful on shape and frame layers getting the ids of bounded variables for color, radius, and other properties using

let variableId = node.fillsi0].boundVariables.color.id;

let variableName = figma.variables.getVariableById(variableId).name;

return variableName;

or 

let variableId = node.boundVariables.topRightRadius.id;

let variableName = figma.variables.getVariableById(variableId).name;

return variableName;

but using 

let variableId = node.boundVariables.fontFamily.id;

let variableName = figma.variableId.getVariableById(variableId).name;

return variableName;

only returns undefined. Inspecting it further, let variableId = node.boundVariables.fontFamily; returns the variable array, like ,{"type":"VARIABLE_ALIAS","id":"VariableID:46003:232"}], but I can’t seem to isolate the id value. Thanks for the help!

I answered you in this thread:

 


Reply