The Text Substitution Language (TSL) is used for adding Attribute, Expression, IF/ELSE logic and HTML to certain types of text |
TSL stands for “Text Substitution Language”. Its function is to substitute TSL-anchors at run-time by the current attribute value.
Additional formatting of these substituted texts is available, for dates and numbers. Furthermore, by using TSL statements combined with functions and expressions, it enables you to create conditional text blocks.
It is possible to use HTML formatting within TSL. If you choose to do so, make sure that the channel you are using supports HTML. |
Where can I use TSL?
The Text Substitution Language (TSL) can for example be used in these Blueriq elements:
Attribute (question text)
Validation rule (message text)
Simplified TSL syntax overview:
TSL | Simplified syntax |
---|---|
TSL anchor | [[[ ]]] |
TSL comment | /* */ |
TSL IF statement | [[[IF expr]]] [[[/IF]]] |
TSL IF ELSE statement | [[[IF expr]]] [[[ELSE]]] [[[/IF]]] |
TSL IF ELSEIF statement | [[[IF expr1]]] [[[ELSEIF expr2]]] [[[/IF]]] |
TSL FOREACH statement | [[[FOREACH entity]]] [[[/FOREACH]]] |
TSL FOREACH IN statement | [[[FOREACH entity IN relation]]] [[[/FOREACH]]] |
TSL FOREACH WHERE statement | [[[FOREACH entity WHERE condition]]] [[[/FOREACH]]] |
TSL FOREACH ORDER BY statement | [[[FOREACH entity ORDER BY attr DESC|ASC]]] [[[/FOREACH]]] |
TSL sequence | [[[#]]] |
TSL format | [[[expression{format}]]] |