Xero Attachments

Export Attachments into Google Sheets

In order to pull Attachments we will use a slightly different approach.

There are several objects where Attachments are available, such as Invoices, Credit Notes, Quotes and POs.

In our example, we will be logging in to our Xero organization through G-Accon for Xero. Our goal today is to build a query that will join two tables – Invoices and Attachments.

The first step is to

  • Go to the menu and select “Extensions” –>
  • Choose “G-Accon for Xero” –>
  • Click on “Get Accounting Data/Reports” –> “Get Data” –> “Get Accounting Data
  • Select a specific table/object

The next step is to select the desired Invoice’s attributes: Invoice ID and Invoice Number and so on. This Invoice ID will be used when we join the second (Attachment) table.

The next step is to

  • Choose “G-Accon for Xero” –>
  • Click on “Get Accounting Data/Reports” –> “Get Data” –> “Get Accounting Data” –>
  • Select Attachments

After selecting the Attachments option from the drop down menu, you can click “all attributes” or “some attributes” based on your preferences.
You can also expand attributes to see the whole structure with sub-attributes, as well as collapse it. The Attachments ID attribute needs to be selected as well.

Next, select the “Filter By IDs” under Select the field to filter by option, highlight the required Invoice IDs range in the google sheet, and use the “reference” icon to insert the data range into template.

To display our data in the same table, we need to adjust the start cell.

In our case, it is a “C1” cell:

As a result, we joined two tables by IDs: Invoices and Attachments and their corresponding details.

Then click on the URI to download an attachment: