======JSONValue(JSON_text, JSONPath) ====== Category: Web function \\ =====Description===== This function extracts a single value or a JSON object/array from a node specified by [[https://goessner.net/articles/JsonPath|JSONPath]]. \\ =====Arguments===== ^Argument^Type^Description^ |JSON_text | Text |A string representing a JSON node. | |JSONPath |Text |The value or JSON object/array to be returned. | **Return value type:** Any (The type of the value being returned.) \\ =====Remarks===== If a result is a JSON array, it's stripped of the wrapping square brackets in order to make further splitting more convenient (e.g. using [[transformations:splitdelimitedtext|Split delimited text into columns]] or [[transformations:subfield|Split delimited text into rows]]). \\ =====Examples===== jsonvalue('{"customer":{"ID":345}}', 'customer.ID') //Returns 345 (Single scalar value) jsonvalue('{"customer":{"ID":345, "name":"Plain Jane"}}', 'customer') //Returns '{"ID":345, "name":"Plain Jane"}' (JSON object) jsonvalue('{"customerIDs":[345,346,347]}', 'customerIDs') //Returns '345,346,347' (JSON array stripped of brackets) \\ =====See also===== * [[syntax:functions:isjson|IsJSON(text)]] * [[syntax:functions:xmlvalue|XMLValue((XML_text, XPath)]]