JSON Parse tool

JSON Parse Tool

Version:
Current
Last modified: July 22, 2020

Use JSON Parse to separates JavaScript Object Notation (JSON) text into a table schema for the purpose of downstream processing. It can be built back up into usable JSON format by feeding the output into the JSON Build tool.

Configure the Tool

JSON Field: Select the fields that hold Java Script Object Notation (JSON) text. The field must contain valid JSON with all the text for a record in a single cell. See this example:

JSON
  1. {
  2.         "firstName": "John",
  3.         "lastName": "Smith",
  4.         "age": 25,
  5.         "address": {
  6.                 "streetAddress": "21 2nd Street",
  7.                 "city": "New York",
  8.                 "state": "NY",
  9.                 "postalCode": "10021"
  10. },
  11. "phoneNumber": [
  12.         {
  13.                 "type": "home",
  14.                 "number": "212 555-1234"
  15.         },
  16.         {
  17.                 "type": "fax",
  18.                 "number": "646 555-4567"
  19.         }
  20.     ]
  21. }

Include in Output: The selected column is included in the data stream coming out of the tool.

Choose how the JSON gets parsed. Choices include:

Output values to a single field: Two fields are output, JSON Name and JSON_ValueString. Looking at the input example above, the following data comes out of the tool:

JSON_Name JSON_ValueString
firstName John
lastName Smith
age 25
address.streetAddress 21 2nd Street
address.city New York
address.state NY
address.postalCode 10021
phoneNumber.0.type home
phoneNumber.0.number 212-555-1234
phoneNumber.1.type fax
phoneNumber.1.number 646-555-4567

Output values into data type specific fields: Five fields are output.

Field Name Description
JSON_Name The JSON_Name is the 'key' of a  JSON Object (key:value pair). A dot separates the key and any hierarchical categories.
JSON_Value String The corresponding string 'value' of the JSON Object (key:value pair). If the value is not a string, it will display as [Null].
JSON_ValueInt The corresponding integer 'value' of the JSON Object (key:value pair). If the value is not an integer, it will display as [Null].
JSON_ValueFloat The corresponding float 'value' of the JSON Object (key:value pair). If the value is not a float, it will display as [Null].
JSON_ValueBool The corresponding bool 'value' of the JSON Object (key:value pair). If the value is not a bool, it will display as [Null].

Example Output

JSON_Name JSON_ValueString JSON_ValueInt JSON_ValueFloat JSON_ValueBool
firstName John [Null] [Null] [Null]
lastName Smith [Null] [Null] [Null]
age [Null] 25 [Null] [Null]
address.streetAddress 21 2nd Street [Null] [Null] [Null]
address.city New York [Null] [Null] [Null]
address.state NY [Null] [Null] [Null]
address.postalCode 10021 [Null] [Null] [Null]
phoneNumber.0.type home [Null] [Null] [Null]
phoneNumber.0.number 212-555-1234 [Null] [Null] [Null]
phoneNumber.1.type fax [Null] [Null] [Null]
phoneNumber.1.number 646-555-4567 [Null] [Null] [Null]

 

Was This Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support.