Expression mode
All arguments have on their top-right corner a JS button which toggles it from the stock UI to a text area where user can write JavaScript code and complex logic.
As the name states, this field expects a JavaScript expression that will be evaluated as the argument value itself, so the value must fit the expected argument types and range of values (when applicable).
JavaScript Expressions are any unit of code that can be evaluated to a value. Here is an interesting article about it.
For example if you set a text value argument of a text element with expression mode to
$.isLoading ? "Loading" : "Done!"
the evaluator will check the context object $ for a isLoading variable to decide if its going display Loading or Done!. (Yes, that is a ternary operator and they are very frequently used in expressions)
There are several other use cases for expression modes, check them out in the section common techniques.
Last modified 5mo ago
Copy link