Parse JSON object into key and value arrays
Recipe ToolsData ParserMarketingUtilities
What it does
When someone calls this automation with a JSON object hash, it parses the document and creates two arrays: one of all keys and one of all values. The automation then logs each key and value to the job report so someone can see the extracted data.
Who it's for
Engineering teams who need to break down JSON objects into separate key and value arrays for data processing.
How teams use this
Map JSON fields to database columns
Extract keys from an API response object to match them against database column names. This ensures data aligns correctly before an import or sync runs.
Validate required fields in payload
Pull all keys from an incoming JSON object and check them against a list of required fields. Add a condition to alert the team if any mandatory keys are missing from the payload.
Transform object data for downstream system
Extract keys and values separately so they can be reformatted and sent to a system that expects a different structure. Add a mapping step to rebuild the data in the target format.
How it works
- Call the function with JSON. Invoke this automation with a JSON object hash as input to begin the extraction process in Workato Recipe Function.
- Parse the JSON document. Json Parser reads the incoming JSON object hash so its structure becomes accessible for extracting keys and values in the next steps.
- Extract keys and values into arrays. Use a formula to create two separate arrays: one containing all keys from the object and one containing all values from the object.
- Log each key and value. Loop through both the keys array and the values array, logging each item to the job report so the results are visible to someone reviewing the output.