Working with Variable JSON Responses
While integrating an event app in Workato, I faced a challenge: each event had unique keys, making it impossible to use datapills directly. Instead of using standard names, the app generated keys with random strings. For example, “Tradeshow Name” appeared as “text0745285851” for one event and “text5295746837” for another.
Solution: Lookup Table
I resolved this by creating a lookup table with three columns:
- Workato Field: The standard field name used across events
- Event Key: The field name specific to each event
- Event ID: A unique identifier for each event
Implementation
With this setup, I used inline lookup formulas within the app’s field mappings. Here’s how it works: in the field where I needed a value, I used the Values key as a datapill, accessing nested objects through an inline lookup.
In this setup, “Event Fields” is the lookup table name, and the formula checks if the Event ID has a corresponding key. If found, it maps the key’s value, making this solution scalable across multiple events without duplicating recipes.