Skip to main content
Solved

Cannot assign variable that is resolved as FLOAT to text node via API

  • February 22, 2024
  • 1 reply
  • 325 views

Calin_Stefanescu

I have a list of variables that I want to apply to text nodes. These variables are numbers. I want to do it via API because there are a lot of them. The problem is that when I try to bind these variables using the “node.setBoundVariable” function, the resolved type for the variable is “FLOAT” and not “STRING”, which is correct, but this prompts the error : “in setBoundVariable: variable of resolved type ‘FLOAT’ cannot be bound to this field”. I undestand that the text node was expecting a string but I can bind the number variable to text manually in the software and I even have a scoping section for “text” when opening the options for the number variable.

Best answer by djv

Hey @Calin_Stefanescu, thanks for reaching out!

This is actually an intentional product limitation. The UI supports binding number variables to text content, because we can have a stringify expression behind the scenes. But since expressions can’t be used for binding in general, the plugin API doesn’t expose expressions, only direct aliases.

View original
This topic has been closed for replies.

1 reply

djv
Figmate
  • Community Support
  • 4774 replies
  • Answer
  • February 23, 2024

Hey @Calin_Stefanescu, thanks for reaching out!

This is actually an intentional product limitation. The UI supports binding number variables to text content, because we can have a stringify expression behind the scenes. But since expressions can’t be used for binding in general, the plugin API doesn’t expose expressions, only direct aliases.


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