In this guide, we'll import Xero purchase orders into Airtable. We'll use the Data Fetcher Airtable app to connect Xero to Airtable and import selected fields from our Xero purchase orders ('Purchase order id', Purchase order number', 'Purchase order date', etc.).
You'll need to connect your Xero account in order to sync the purchase orders into Airtable. Finally, we'll schedule our Xero purchase orders to sync with Airtable automatically.
Install Data Fetcher from the Airtable app marketplace. After the app launches, sign up for a free Data Fetcher account by entering a password and clicking 'Sign up for free'. If you already have a Data Fetcher account, sign in using the 'Have an account?' button at the bottom left of the box.
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.
On the create request screen in Data Fetcher, for Application, select 'Xero'.
Under Authorization click 'New' to create a new Connection.
You will be taken to a new tab/window where you'll need to authorize Data Fetcher to read from your Xero account. Log onto your Xero account using your user name and password.
Select the Company you want to give access to (for this example, we are using the Demo Company data).
Click on 'Allow Access'.
In Data Fetcher for Endpoint, select 'List all purchase orders'.
You can also add a Name for your request, e.g. 'Import Xero Purchase Orders'.
Click 'Save & Continue'.
On the next screen, select the Organization you want to import purchase orders for.
The Status option allows you to fetch only purchase orders that have a specific status (e.g. 'Authorised', 'Deleted', 'Draft' ). Leave this blank to import all purchase orders.
The Modified after date option allows you to only fetch purchase orders modified after a specified date. Leave this blank to import all purchase orders.
Select the Output Table & View you want to import the purchase orders into.
Click 'Save & Run'.
This request will run, and the Response field mapping window will open. This is where you set which fields from Xero will map to which fields in the output table.
You can easily find the fields you want to import using the 'Find field' search bar.
Make sure you import the 'Purchase order id' field, as we will use this to ensure the purchase order data we import into Airtable is kept in sync with any changes in Xero.
We will import the 'Purchase order id', 'Purchase order number', 'Purchase order date', 'Delivery address', 'Status' and 'Total' fields.
You can choose whether to add these to existing Airtable fields or to create new ones. You can also choose the type of any new field (e.g. Single line text, Multi line text, Email etc.)
Click 'Save & Run'.
Data Fetcher will create any new fields in the output table, then run the request and import all the purchase order data from Xero to Airtable. You can now choose to view the output table.
We'll also need to ensure Data Fetcher can match up items in Xero with records in Airtable and check all data is syncing correctly. To do this, click 'Advanced settings' to open the advanced output settings. Then for Update Based on Field, select 'Purchase order id'.
Instead of manually running a request to import new purchase orders we can use Data Fetcher's scheduled requests feature to automatically import them every 15 minutes/ hour/ day etc. This also means any changes you have made to your existing purchase orders in Xero will sync with Airtable.
To enable this, you'll need a paid Data Fetcher account.
In Data Fetcher, scroll to Schedule and click 'Upgrade'.
A new tab will open where you can select a plan and enter your payment details to upgrade.
Return to the Data Fetcher app and click 'I've done this'.
Click 'Add API key' in order to add your Airtable API key. You can find your Airtable API key here.
Enter your Airtable API key and click 'Save'.
Enable Schedule this request.
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 automatically import any new purchase order you have added to Xero, plus sync any changes you have made to existing purchase orders.