Response field mapping
The response field mapping is where you select which fields should be imported from an application and how they map to the Airtable fields in your output table.
For each field, you can either import or filter it. For an imported field, you can set whether to map it to an existing field or create a new field in your output table.
Create the response field mapping
When creating a request for the first time, click Save & Run and the Response Field Mapping modal will open.
This modal will have a list of all the possible fields you can import from the application and a preview of the first 100 records.
For each response field:
Choose whether to select it or deselect it. Data in the selected fields will be imported when the request runs.
Map it to an existing field by selecting Existing field then choosing a field from the output table.
Map it to a new field by selecting New field, entering a field name and selecting a field type. Data Fetcher will automatically suggest field types based on the response data.
You can also search for fields using the Find field input.
Click Save & Run. Any new fields will be created, and the data will be imported.
Open the response field mapping
After you have set up the field mappings once, you can open the response field mapping at any point from the create request screen by selecting Open field mapping.
Refresh fields
When the API response changes, e.g. because you changed a parameter, you can refresh the fields available on the response field mapping. This will not use any of your monthly usage limits and your existing mapped fields will be preserved.
Click Open field mapping.
Click Refresh fields in the top right-hand corner.
View the raw response
The fields and records on the Response Field Mapping have already been converted into tabular data. To view the actual JSON/ XML response that is returned by the API:
Click the open settings sidebar icon on the left-hand side.
Click Response preview to show the JSON or XML response.
For paginated and Run on Multiple Record requests, it shows the response from only the first request.
Copy or download the JSON response
You can copy the JSON response to your clipboard or download it locally. This can be useful when working out the necessary JMESPath for the JSON.
Click the open settings sidebar icon on the left-hand side.
Click Response preview.
Above the JSON on the left-hand side, click Copy or Download.
Formula
If you need to transform a field's values before they reach the output table, you can do this by specifying a formula for the field. You should reference the value as value
, e.g. upper(value)
. A full list of formulas can be found here.
You can also test formulas quickly in our JavaScript Formula Playground.
Enter the Formula in the input.
Click Save.
Linked records in response field mapping
Data Fetcher can create and update linked records when a request is run.
For example, you might have a request that fetches users and another that fetches tasks, where each task has a user assigned (by user id). You want to create the links between the tasks table and the users table when the request is run.
To use an existing linked field:
To create a new linked field:
When the request runs, Data Fetcher will create links to the linked table by looking for the response value in the linked table field. Anywhere it cannot find a record to link to, it will create a new record and link to that instead.
Link to multiple records
Data Fetcher can turn comma-separated values into multiple linked records. To enable this:
Under Allow multiple links, select Allow.
Create missing linked records
By default, Data Fetcher will create any missing records in the linked table. You can turn this behaviour on or off. It can be useful to turn this off when the linked table is read only, e.g. because it's a read-only Synced table.
Under Create missing records, enabled or disable Create.
Attachment field type
Add to existing attachments
By default, any existing attachments in a field will be overwritten when a request runs. You can add to existing attachments, rather than overwriting them:
Under Attachment write mode, enable the Add to existing setting.
Click Save.
Only write attachment if the cell is empty
Attachments will be written to the field's cell they are mapped to every time you run the request. You can change this behaviour, so that they are only written if the cell is empty:
Under Write the attachment only if the cell is empty., enable the Only if empty setting.
Click Save.
Troubleshooting
Every time you change the Response data transformations Response JMESPath or Max response records the response field mapping is refreshed.
Data Fetcher suggests data types by looking at the response data, but you can change these. E.g., it might suggest
Number
when in reality you wantCurrency
.Be careful when changing the data type from the suggested one, as it can lead to errors if the values cannot be converted. e.g. if the response returns
"sdlf3421asd"
in a field that you specified asNumber
Data Fetcher will fail when trying to update the field.
Last updated