parseJson - Amazon QuickSight

Important: We've redesigned the Amazon QuickSight analysis workspace. You might encounter screenshots or procedural text that doesn't reflect the new look in the QuickSight console. We're in the process of updating screenshots and procedural text.

To find a feature or item, use the Quick search bar.

For more information on QuickSight's new look, see Introducing new analysis experience on Amazon QuickSight.


Use parseJson to extract values from a JSON object.

If your dataset is stored in QuickSight SPICE, you can use parseJson when you are preparing a data set, but not in calculated fields during analysis.

For direct query, you can use parseJson both during data preparation and analysis. The parseJson function applies to either strings or to JSON native data types, depending on the dialect, as shown in the following table.

Dialect Type
Amazon Redshift String
Microsoft SQL Server String
Teradata JSON
Oracle String
Presto String
Snowflake Semistructured data type object and array
Hive String


parseJson(fieldName, path)



The field containing the JSON object that you want to parse.


The path to the data element you want to parse from the JSON object. Valid path syntax includes:

  • $ – Root object

  • . – Child operator

  • [ ] – Subscript operator for array

Return type



The following example evaluates incoming JSON to retrieve a value for item quantity. By using this during data preparation, you can create a table out of the JSON.

parseJson({jsonField}, “$.items.qty”)

The following shows the JSON.

{ "customer": "John Doe", "items": { "product": "Beer", "qty": 6 }, "list1": [ "val1", "val2" ], "list2": [ { "list21key1": "list1value1" } ] }

For this example, the following value is returned.



The following example evaluates JSONObject1 to extract the first key value pair (KVP), labeled "State", and assign the value to the calculated field that you are creating.

parseJson(JSONObject1, “$.state”)

The following are the given field values.

JSONObject1 ----------- {"State":"New York","Product":"Produce","Date Sold":"1/16/2018","Sales Amount":"$3423.39"} {"State":"North Carolina","Product":"Bakery Products","Date Sold":"2/1/2018","Sales Amount":"$3226.42"} {"State":"Utah","Product":"Water","Date Sold":"4/24/2018","Sales Amount":"$7001.52"}

For these field values, the following rows are returned.

New York North Carolina Utah