The problem
For example, if calling a currency conversion API gives us this JSON:rates. For example, rates.2020-01-01.USD and rates.2020-01-02.USD would be treated as separate fields.
If we change the request parameters to use different dates (like 2021-01-01 to 2021-01-03), we get completely new keys under rates that won’t map to any existing fields:
Date field and a Rates USD field, and the different dates to be added as different records with these two fields.
We can do this by denormalizing the response. When we denormalize the response and run the request, the response will be transformed into:
The solution
What we really want is just two consistent fields: aDate field and a USD field. We want different dates to appear as separate records with these same two fields.
We can do this by denormalizing the response. We set:
- **Denormalize Path **to
$.rates(the JSONPath expression for the top-levelrateskey) - Denormalize Field Name to
Date
rates.Date field and all USD exchange rates appear under a consistent rates.USD field. This gives us stable field names that we can reliably map to our output table.
How to denormalize the response
- On the create screen, scroll to the bottom and click to open the Advanced Settings.
- Under Denormalize Path, enter the JSONPath to where you want to denormalize the data (for the example above, use
$.rates). - Enter a Denormalize Field Name for the field that will be added to each record (for the example above, use
Date).