Response data transformations
Last updated
Last updated
When you run a request, the API response data (JSON/XML/CSV) is transformed into a tabular format (fields and records) and written to your output table. You configure this mapping using the .
There are two different data transformations you can use: Single Record or Expanded. These handle nested arrays in slightly different ways.
Let's say our API returns this JSON response:
Using the Single Record transformation, the nested positions.id
values are combined into one field, separated by a comma. This ensures each parent entity (a company in this example) is contained within a single Airtable record.
The above response would be transformed into these fields and records:
Note that Single Record does not mean everything in the response is put into one record. Data Fetcher looks for the first array in the response and puts each item in that array into a single record.
Using the Expanded transformation, each nested positions.id
values would create a new record, duplicating the parent entity into multiple records.
The JSON response above would be turned into these fields and records:
Under Data Transformation, select the transformation you want from the options.
We saw in the example above that when the transformation is set to Single Record, the nested positions.id
fields are all combined into one 'Positions id' single-line text field, separated by a comma:
You can disable this so that each positions.id
values is given its own field, pre-fixed with a number:
The response would then be transformed into these fields and records:
To disable the combining of nested object keys:
Under Data Transformation, ensure the transformation is set to 'Single Record'.
Switch 'Combine nested object keys' off.
Similarly, by default, arrays of text/numerical values are combined into one comma-separated value.
For the following JSON response:
The text items in the categories
arrays are combined into one field as comma-separated strings:
You disable this behaviour so that each array item is put into a new field like this:
To disable this behaviour:
Under Data Transformation, ensure the transformation is set to 'Single Record'.
Switch 'Combine arrays of text/numbers' off.
You can use the Separator input to enter a custom separator, if you don't want your values to be comma-separated. For example, if your values include commas, then you might want to use the pipe (|) symbol as the separator instead.
On the create request screen, click to open the advanced settings.
On the create request screen, click to open the advanced settings.
On the create request screen, click to open the advanced settings.
If you want even more flexible data transformation, try using a .