fromjson

string

Parses a JSON string into a value

Syntax

fromjson(string)

Parameters

string (string)

The JSON string to parse

Returns

any

Parsed value from JSON

Examples

Input:
fromjson("{\"name\":\"Alice\"}")
Output:
{name: "Alice"}
Input:
fromjson("[1,2,3]")
Output:
[1, 2, 3]
Input:
"{\"x\":1}" | fromjson
Output:
{x: 1}

The fromjson() function parses a JSON string and converts it back to its original data structure (object, array, or primitive value).

Usage

Use fromjson() for parsing JSON API responses, deserializing stored data, or processing JSON-formatted strings in your data pipeline.

Related Functions