Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

This section describes how to escape strings in your transformstransformations.

In the platform, the backslash character (\) is used to escape values within strings. The character following the escaping character is treated as a string literal.

For example, the following value is used to represent a matching value of & only:

d-code
value:
`\&`

Escaping can be applied to parameters in functions. For example, in the data grid, you have the following values in a column:

...

To find the value can't, you could enter the following pattern:

d-

...

trans
p03Value'MyFindResults'
Typestep
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueFIND(MyStringCol, 'can\'t',true,0)

...

p03NameNew column name
SearchTermNew formula

The above transform transformation results in the following:

...

Below, you can see how this JSON pattern is specified in an example unnest transformthe following example transformation:

d-

...

trans
Typestep
p01NameColumn
p01ValueMyCol
p02NamePaths to elements
p02Value[\"re\\\"becca\"]

...

SearchTermPivot columns

  • The keys value must be single-quoted. Since the keys are specified for Object data, the square bracket notation is used. 
  • Within the square brackets, the individual keys must be double-quoted. 
  • The first two backslashes (\\) indicate that you are escaping a single backslash character.
  • The third backslash indicates that you are escaping the double-quote that is part of the string to match.

In the following example, you are trying to match on the above string, including the double-quotes around it: "re\"becca"

d-

...

trans
Typestep
p01NameColumn
p01ValueMyCol
p02NamePaths to elements
p02Value'[\"re\\\"becca\"]'
SearchTermPivot columns

The bracketing double-quotes must be escaped, too.