Skip to main content

Escape JSON Strings to Use Python in Torq

Learn how to properly escape JSON strings and take advantage of using Python code in Torq.

When using Python scripts with workflow data in JSON format, escaping the JSON string is essential. Escaping special characters prevents code injection attacks and ensures your JSON data remains valid.

Torq provides two ways to escape JSON strings:

  • jsonEscape function: Use the Escaped string output of the Utils step.

  • Escape JSON string step: Use the Escape JSON string String Utils step.

jsonEscape function

json-escape-function

Escape JSON string step

escape-json-step
Did this answer your question?