# JSON tools by Workato – Parse JSON document action
The Parse JSON document action extracts values from raw JSON content and converts them into structured datapills for use in recipes.
# Input
Input field | Description |
---|---|
Sample document | Provide a sample JSON document that defines the expected structure of the input. Workato uses this to generate the output schema. |
Document | Provide the raw JSON content to parse. This must match the structure of the sample document. |
Encoding of the file content | Set the encoding format of the JSON string. If left blank, Workato uses UTF-8 by default. |
Edit schema | Select fields to override in the generated schema. Use this to refine the datatree if the sample doesn't fully reflect the actual data. |
# Output
Output fields | Description |
---|---|
Document | Workato generates datapills based on the structure defined in the Sample document. These datapills reflect the hierarchy and keys of the sample JSON, including any nested objects or arrays. |
# Example usage
The following example defines a JSON structure for an array of contacts. Each contact includes a Name
object, an Address
object, and a phone
field.
[
{
"Name": {
"first_name": "Sally",
"last_name": "Jones"
},
"Address": {
"street": "20450 Stevens Creek Blvd #150",
"city": "Cupertino",
"st": "CA",
"postal": "95014"
},
"phone": "4105554119"
},
{
"Name": {
"first_name": "Bob",
"last_name": "Towner"
},
"Address": {
"street": "1 Hacker Way",
"city": "Menlo Park",
"st": "CA",
"postal": "94025"
},
"phone": "8552982507"
}
]
Use this structure in the Sample document field. Workato generates output datapills that reflect this structure, including nested fields under Name
and Address
.
Last updated: 4/1/2025, 2:07:47 AM