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
    icon on the left-hand side to open the settings sidebar.
  • Click Response preview to show the JSON or XML response.
    • For a JSON response, you can click on any value in the JSON response to toggle whether it is imported or not. You can also click on the
      next to a field name to go to that field in the 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
    icon on the left-hand side to open the settings sidebar.
  • On the Response field mapping modal, 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.
  • Click on
    to open the field's settings.
  • 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:
  • Select
    then choose a linked field in your output table with
    .
  • By default, Data Fetcher will use the primary field in the linked table to find the record to link to. To change this, click
    then select a different field under Linked table field.
To create a new linked field:
  • Select
    , enter a field name in
    and change the field type to
    .
  • Click
    to open the field settings, and select a table to link to under Linked table.
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.
Data Fetcher can turn comma-separated values into multiple linked records. To enable this:
  • Click
    next to the field name to open the field settings.
  • 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.
  • Click
    next to the field name to open the field settings.
  • Under Create missing records, enabled or disable Create.

Attachment field type

Data Fetcher can map a remote file URL (e.g. a PNG, SVG or PDF) in a response to an Airtable attachment field. To do this, select
for the type in the response field mapping.

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:
  • For an attachment field, click
    next to the field name to open the field settings.
  • 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:
  • For an attachment field, click
    next to the field name to open the field settings.
  • 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 want Currency.
  • 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 as Number Data Fetcher will fail when trying to update the field.