Escape JSON Field

BlockNetwork

Escape a string to be used as a JSON field.

Inputs

StringRequired

String to escape.

Outputs

Escaped String

Escaped string safe for JSON fields.

Example: \"hello\"

Build a bot using blocks like Escape JSON Field

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: escape_json_field

Inputs

FieldInventScript nameValue
Stringstring

Outputs

FieldInventScript nameValue
Escaped Stringescaped_stringe.g. "\\\"hello\\\""

Example InventScript

escapeJsonField := escape_json_field(Args{string: "..."})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Escaped String: " + escapeJsonField.escaped_string,
})

More network blocks