Using JSON Parser to Handle Keys With Periods
Recently, while building a recipe in Workato with an HTTP connector, I encountered JSON keys containing periods. This setup led to errors with invalid datapills. While the recipe ran, it generated empty data, creating blank rows instead of useful records.
Initial Workaround: Hardcoding Keys
Using a ‘for each’ action, I could manually hardcode keys in formula mode:
However, this solution didn’t support bulk actions, so I sought an alternative with Workato support.
The Solution: JSON Parser
Workato Support suggested using the JSON Parser with a modified JSON structure:
- In the Sample document box, add JSON without periods (e.g.,
coursename
instead ofcourse.name
). - In the Document box, apply formula mode to modify the response:
[Response | Step 4].to_s().gsub('.','').gsub('=>',':').gsub('nil','null')
With this setup, I could access bulk actions by taking the parsed response directly from the JSON parser step.