From Bright Pattern Documentation
(Updated via BpDeleteTranslateTags script) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | = Variable Parameters = | |
This section describes parameters you may add to your [[Scenario-builder-reference-guide/Reference/VariablesandExpressions/Variables|scenario]] or [[Workflow-builder-reference-guide/Variables|workflow]] variables. | This section describes parameters you may add to your [[Scenario-builder-reference-guide/Reference/VariablesandExpressions/Variables|scenario]] or [[Workflow-builder-reference-guide/Variables|workflow]] variables. | ||
Line 44: | Line 44: | ||
The following will be returned: | The following will be returned: | ||
− | <pilot name="Pete | + | <pilot name="Pete &quot;Maverick&quot; Mitchell"> |
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 04:04, 29 May 2024
• 5.19 • 5.8
Variable Parameters
This section describes parameters you may add to your scenario or workflow variables.
How to Use a Variable Parameter
A variable parameter is added within the variable selector (i.e., inside the parentheses) after the variable and separated by a comma.
$(variable,parameter)
For example:
$(item.from,escapejson)
Usage Notes
- The variable parameter, but not the variable itself, is case insensitive. For example, escapejson, escapeJSON, and EscapeJson are treated the same.
- The variable parameter should not be enclosed in single or double quotes; it is considered to be part of the variable name.
- The variable parameter is allowed to have whitespaces before and/or after comma; they are trimmed out in the runtime.
- Multiple parameters cannot be invoked within the same variable.
Parameters
escapejson
When invoked, escapejson will escape (i.e., insert a backslash in front of) invalid JSON characters from the value of the variable. This includes the following:
- Double quotes (")
- Backslashes (\)
- Any control characters (e.g., \n)
For example, where $(item.from) = Pete "Maverick" Mitchell:
{"pilot": "$(item.from,escapejson)"}
The following will be returned:
{"pilot": "Pete \"Maverick\" Mitchell"}
escapeXML
This parameter escapes characters that break XML structure, to rephrase the above example:
For example, where $(item.from) = Pete "Maverick" Mitchell:
<pilot name="$(item.from,escapeXML)">
The following will be returned:
<pilot name="Pete "Maverick" Mitchell">