Format JSON

BlockNetwork

Indent a JSON string for readability.

Inputs

JSON StringRequired

JSON string to format.

Outputs

Formatted JSON

Pretty-printed JSON string.

Example: { "key": "value" }

Build a bot using blocks like Format JSON

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: format_json

Inputs

FieldInventScript nameValue
JSON Stringjson_string

Outputs

FieldInventScript nameValue
Formatted JSONformatted_jsone.g. "{\n \"key\": \"value\"\n}"

Example InventScript

formatJson := format_json(Args{json_string: "..."})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Formatted JSON: " + formatJson.formatted_json,
})

More network blocks