How to Import a Remote XML file in Airtable

In this guide, we'll import a remote XML file to Airtable. We'll use the Data Fetcher Airtable app to import the XML file and decide how the file's fields should map to our Airtable fields. Finally, we will set it to import on a regular schedule.

Install Data Fetcher

Install Data Fetcher from the Airtable app marketplace. Data Fetcher is a free Airtable app that lets you connect to any XML, JSON or CSV API. After the app launches, sign up for a free Data Fetcher account by entering a password and clicking 'Sign up for free'.

Group 1Data Fetcher Sign Up .png

Import a Remote XML File in Airtable

On the home screen of the Data Fetcher app, click 'Create your first request'. Requests in Data Fetcher are how you import data to or send data from your Airtable base.

click-create-your-first-request.png

On the create request screen in Data Fetcher, for Application, select 'Custom'.

custom-application-selected.png

Enter a Name for your request, e.g. 'Import XML'.

Enter the URL for your remote XML file. For the purpose of this demo, we will use an open data XML file for food ratings from the UK government. The URL is http://ratings.food.gov.uk/OpenDataFiles/FHRS111en-GB.xml.

import-xml-file-name-url.png

Select the Output Table & View you want to import the remote XML file into.

output-table-1.png

Click 'Save & Run'.

import-file-save-run.png

The request will run and the Response field mapping modal will open. This is where you set how the fields from the XML file should map to fields in the output table. For each field name in the XML file, you can either import or filter it. For an imported field, you can set whether to map them to an existing field or create a new field. You can also set the field type for each new field. Once you are happy with the mapping, click 'Save & Run'.

import-xml-file-response-field-mapping.png

Data Fetcher will create any new fields in the output table, then run the request and import the data from the remote XML file to Airtable. You should now see the XML file's data in the output table.

import-xml-file-imported-data.png

If the XML file has a unique field that identifies each row of data (e.g. an 'Id' field), you might want to open the 'Advanced settings', and set this field as the Update based on field.

Import Remote XML File on a Schedule

At the moment, we have to click 'Run' in order to import the data from the XML file at the remote URL. We can use Data Fetcher's scheduled requests feature to automatically import it every 15 minutes/ hour/ day etc.

In Data Fetcher, scroll to Schedule and click 'Upgrade'.

table-1-schedule-upgrade-button.png

A new tab will open where you can select a plan and enter your payment details to upgrade.

Screenshot 2021-12-29 at 10.25.19.png

Return to the Data Fetcher app and click "I've done this".

table-1-schedule-ive-done-this-button.png

Click 'Add API key' in order to add your Airtable API key. You can find your Airtable API key here.

Group 11(1).png

Enter your Airtable API key and click 'Save'.

save-airtable-api-key.png

Enable Schedule this request.

schedule-data-fetcher-request.png

Select how often you want the request to run, e.g. 'Every 15 mins'. Click 'Save' The request will now run on the schedule and import the data from the remote XML file automatically.

Group 11(2).png