Actions2
JSON to TOON
AI-generatedSummary
Convert each input item’s selected JSON value to a TOON string and store it in the configured output field. Optionally include estimated token comparison metrics and configure array delimiters, indentation, and safe key folding.
Inputs
- Input Data — Value to encode. Defaults to the entire input item’s JSON; can also select a field or nested path such as
users[0].name. - Output Field — Field in each output item where the TOON string is stored; defaults to
data. - Additional Options — Delimiter for array values (comma, tab, or pipe; defaults to comma), indentation spaces (defaults to 2), key folding (
offorsafe; defaults to off), and flatten depth when safe folding is enabled (defaults to 999, treated as unlimited). Enable Include Token Metrics to add estimates for JSON tokens, TOON tokens, tokens saved, and reduction.
Output shape
One output item per input item, retaining its existing JSON fields and adding the TOON string under the configured output field.
When token metrics are enabled, also adds a
tokenMetricsobject withjson,toon,saved, andreductionfields. Token counts are estimates calculated as text length divided by four, rounded up. Encoding errors fail the item unless Continue On Fail is enabled.