From Bright Pattern Documentation
< 5.19:Workflow-builder-reference-guide
Revision as of 04:04, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 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 &quot;Maverick&quot; Mitchell">

< Previous | Next >