1. Handlebars Helpers
  2. To JSON String

Handlebars Helpers

To JSON String

Returns a JSON String for the value passed in

Uses

You can use this helper to convert an object, value, or array to a JSON string.
This is helpful when you want to pass some data to an LLM task as a JSON. You can use this inline to convert the data to a JSON string directly in prompts.

TIP

You could use the JSONata hashtag helper to convert the other way, from a JSON string back to an object.

Usage

Helper name : to_json_string

Parameter Description
1 object / value / array to convert to JSON string

Examples

Example use in task:

loading...

Substituted definition

loading...