Embed Expressions in String Fields
To use a FlowForce expression in a string field, enclose the expression within curly braces, that is, the "{" and "}" characters. The expression part of a string field normally has a light purple background, which helps you distinguish the expression part from the rest of the string, for example:
In a string field, only the expression enclosed within curly braces will be treated by FlowForce as an expression. If you want FlowForce to interpret the "{" and "}" characters literally, write double braces instead of a single brace. Consider the following cases:
A string field with the following value... | Will be evaluated as... | Explanation |
---|---|---|
echo Hello, World! | The string does not use any curly braces (it does not contain an embedded expression), so it is evaluated as is. | |
- | The string cannot be evaluated. The embedded expression is not syntactically correct, so FlowForce displays a syntax error. | |
echo Hello, World! | The string contains an embedded expression which is syntactically correct. However, the expression is inside a string field, so the evaluation result would be the same if you used no expression at all (see the first example above). | |
echo {'Hello, World!'} | The string does not contain an expression, since the escape characters {{ and }} were used. |