Skip to main content

$(jsonEscape)

$(jsonEscape [text])

Escapes quotes, backslashes and newlines so text fits inside a JSON string. The surrounding quotes are not added; write those in your template. Use it in flows when building a webhook payload with the Generate Text node.

Examples​

$(jsonEscape say "hi")

Will display say \"hi\"

{ "message": "$(jsonEscape {{message}})" }

Will produce valid JSON even when the chat message contains quotes