XO.CONTACTS
Get the contacts list for an organization. By default returns only Active contacts. Returns a table with 7 columns that spills into Excel.
Syntax
Parameters
| Parameter | Required | Description |
|---|---|---|
| org_id | Yes | Organization ID from XO.ORG() |
| include_archived | No | 0 = Active contacts only (default), 1 = All including archived |
Returns
A table with 7 columns:
Examples
Active contacts only:
=XO.CONTACTS(A2)Returns a spilling table of all active contacts.
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 — you don't need to write VSTACK manually.
Advanced: Manual VSTACK Formula
To manually combine contactsfrom 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 readable guidance messages for connection issues (not caught by IFERROR) and standard Excel errors (#VALUE!, #N/A) for data problems — hover over the cell to see the specific message.