Skip to main content
Back to Functions

XO.CONTACTS

Get the contacts list for an organization. By default returns only Active contacts. Returns a table with 6 columns that spills into Excel.

Syntax

=XO.CONTACTS(org_id, [include_archived])

Parameters

ParameterRequiredDescription
org_idYesOrganization ID from XO.ORG()
include_archivedNo0 = Active contacts only (default), 1 = All including archived

Returns

A table with 6 columns:

Org ID
Org Name
Name
Email
Account Number
Status

Phone numbers are available in the Contacts table from the task pane, not this formula.

Examples

Active contacts only:

=XO.CONTACTS(A2)

Returns a spilling table of all active contacts.

Org ID
Org Name
Name
Email
Account Number
Status
DEMO
Demo Org
Acme Ltd
info@acme.com
ACME001
ACTIVE
DEMO
Demo Org
Beta Corp
hello@beta.co
BETA001
ACTIVE

Include archived contacts:

=XO.CONTACTS(A2, 1)

Multi-Organization Data

Using the Functions Tab

When connected to multiple Xero organizations, open the Functions tab in the task pane and select which organizations to include. Click "Insert Function" and the formula will be created for you, so you don't need to write VSTACK manually.

Advanced: Manual VSTACK Formula

To manually combine contacts from multiple orgs, use Excel's VSTACK function:

=VSTACK(XO.CONTACTS(A2), DROP(XO.CONTACTS(A3), 1))

The DROP(,1) removes the duplicate header row from the second result.

Troubleshooting

If you see an error, check the troubleshooting guide. XO Report shows standard Excel errors (#VALUE!, #N/A) for connection and data problems. To show a blank or your own message instead of an error, wrap the formula in IFERROR. Hover over the cell to see the specific message.

For a complete overview of building Xero reports in Excel, including how this function fits into a full workflow, see our complete Xero to Excel guide.

Related Functions