Data Fetcher Help Center
🚀 Try for free📮 Support
  • 👋Welcome
  • Create Requests
    • Create a request
    • Use table values in requests
    • Use variables in requests
    • Response field mapping
    • Schedule a request
    • Add a request trigger
    • Troubleshoot errors
    • Run request using webhook URL
    • Pre-built integrations
  • Custom Requests
    • Create a custom request
    • Set request method
    • Set request parameters
    • Request authorization
    • Set request headers
    • Add request body
    • Connect to a preset OAuth API
    • Create a custom OAuth connection
  • Advanced settings
    • Write modes
    • Update based on field(s)
    • Pagination
    • Response data transformations
    • Response JMESPath
    • Add fixed value to output
    • No output mode
    • Rate limit
    • Max response records
    • Run request from button field
    • Denormalize response
    • XML array handling
    • Fixed IP Address
  • Organise Requests
    • Run history
    • Duplicate a request
    • Delete a request
    • Add request description
    • Import request from cURL command
    • Export requests as JSON file
    • Import requests from JSON file
  • Create Sequences
    • Create a sequence
    • Schedule a sequence
    • Run sequence from button field
    • Run sequence using webhook URL
  • Account
    • Upgrade workspace
    • Authorize Data Fetcher and Airtable
    • Add user to workspace
    • Roles and permissions
    • View monthly usage
    • Update personal details
    • Update payment card
    • Update billing information
    • View invoices
    • Switch workspace
  • Get a Google Maps API Key
Powered by GitBook
On this page
  • Set Update based on field(s)
  • Example
  1. Advanced settings

Update based on field(s)

Last updated 6 months ago

If you're using the and each record in your API response has a unique field, such as an id field, you can use this field to merge the response data with the existing records in your output view. See the to understand why this is helpful.

Set Update based on field(s)

  • On the create request screen, click to open the advanced settings.

  • Under Write Mode, ensure 'Update' is selected.

  • Under Update Based on Field(s), select the field from your output table. You can select more than one field if needed.

When you are , you should usually keep Update Based on Field(s) set to 'None'. The output record's position in the Run on Multiple Records table/view will then be used to update it.

Example

We can understand why we need this with an example. Let's say the existing data in our output view in Airtable is:

Item Id
Item name
Units sold

229

Orange Hat

5

107

Purple Skirt

10

And the API response data (after being transformed from JSON) is:

Item Id
Item name
Units sold

692

Blue T-Shirt

7

229

Orange Hat

10

107

Purple Skirt

17

After a run with the write mode set to Update and Update Based on Field(s) set to 'None', the output view will be:

Item Id
Item name
Units sold

692

Blue T-Shirt

7

229

Orange Hat

10

107

Purple Skirt

17

The issue here is that before we ran the request the first record in our output view was associated with the 'Orange Hat' item. Now the first record is being used for 'Blue T-Shirt' and the second is associated with 'Orange Hat'.

If we had linked other records to the first record, added comments or values in other fields, these will now be associated with the wrong item.

We can avoid this by setting the Update Based on Field(s) to 'Item Id', a unique field that Data Fetcher can use to match the items in the response to those in the output view.

After a run with the Update Based on Field(s) set to 'Item Id', the output table will be:

Item Id
Item name
Units sold

229

Orange Hat

10

107

Purple Skirt

17

692

Blue T-Shirt

7

Perfect! Now the Units sold values and Item name field values have been updated (although only the Units sold values changed), by using the unique Item Id field to merge the records.

Data Fetcher will only look at the records in your output view, not the entire output table. So if you have filters applied to the output view that prevent it from finding a matching record, a duplicate record will be created.

example below
running on multiple records
Update write mode