-
Notifications
You must be signed in to change notification settings - Fork 18
Canvas Advanced String Variables
To get the value of a text field on the card, we can use the simple Text Variable. But sometimes, a more complex value is needed. For example, concatenating two strings.
Some fields also propose different types of values, such as the Dropdown Menu, who has a selected value, and a selected text. Which one to display ?
The Advanced String Variables exist for these situations.
An Advanced String Variable can be used by setting a canvas' field to a string that contains the token $myVariable$. Unlike normal text variables, this variable can be set anywhere in the string :
"text": "My Name is $name$"
You can even have multiple variables in the same string :
"text" : "My Name is $name$ and I'm $age$ years old"
And that's it !
The following editable fields generate an advanced string variable :
- Input Text (get the text set in the field)
- Multiline Text (get the text set in the field)
- Dropdown Menu (get the text displayed for the selected item)
- Rich Text Field (get the displayed text, without the formatting)
Some fields have special values accessible from the advanced string variables. If nothing is specified, then only the classic use will work.
A special value is used in the same way as a normal advanced string variable, but requires the use of an attribute :
"text" : "My Name is
As you can see, we have added the value attribute to the age variable by using a dot between the variable & the attribute. The existing attributes are listed below.
Dropdown Menus have two special values :
- text is the text displayed in the field, that the user selected
- value is the value of the selected option, that can be more of a constant, with less information.
Rich Text Fields have two special values :
- text is the text entered in the field, without the formatting (bold, italic).
-
html is the html version of the text (with attribute
<b>
for bold,<i>
for italic,<br>
for linebreaks, ...
Feel free to post your questions via Issues if something is unclear or missing in the wiki. Better documentation = Better templates !