Advanced Dext to Xero Bill Automation with Multi-Level Logic (Make.com)

Streamline expense processing with automated line-item mapping and conditional approvals using Make.com.

Tools: DextXero

Platform: Make.com

Short Answer

A robust Make.com scenario that automatically routes extracted Dext data into Xero as draft bills. It includes a high-value filter for manager approval and leverages Make.com's Array Aggregator to ensure consistent line-item mapping and duplicate prevention.

The Problem

Native Dext-Xero integrations often lack the flexibility to handle complex approval workflows or custom project tracking. Businesses struggle with high-value invoices being pushed to Xero without oversight or loss of data granularity when handling multi-line receipts.

The Outcome

A robust Make.com scenario that automatically routes extracted Dext data into Xero as draft bills. It includes a high-value filter for manager approval and leverages Make.com's Array Aggregator to ensure consistent line-item mapping and duplicate prevention.

Step-by-Step Guide

1. **Create Connection**: In Make.com, add the **Dext** module 'Watch Items'. Authenticate by logging into your Dext account. Set the 'Status' to 'Ready' to only pull extracted items. 2. **Initialize Search**: Add a **Xero** 'Search for Contacts' module. Map the `Supplier Name` from Dext to the 'Name' field in Xero to prevent duplicate contact creation. 3. **Conditional Logic (Router)**: Add a 'Router' module. On the top path, set a filter: `Total Amount` > `1000`. Direct this to a Slack 'Create a Message' module to notify a manager. 4. **Data Iteration**: Use a **Make.com Iterator** if the Dext response contains an array of line items. This allows you to process specific VAT rates or tracking categories separately. 5. **Data Enrichment**: Use the 'Get Variable' or a 'Search' module to pull Xero Tracking Categories based on Dext labels or projects. 6. **Map the Bill**: Add the **Xero** 'Create a Purchase Invoice (Bill)' module. Map `Reference` from Dext to `InvoiceNumber` in Xero. Set 'Status' to `DRAFT` for extra safety. 7. **Array Aggregator**: Before the Xero module, use an **Array Aggregator**. Set the 'Source Module' as the Iterator and the 'Target Structure' as the Xero 'Line Items' field. Map Dext's `Description`, `Quantity`, and `UnitAmount`. 8. **Define Tax Rates**: Use the `map()` function or a 'Switch' formula in Make to translate Dext Tax names (e.g., '20% VAT') to Xero Tax Type codes (e.g., 'INPUT2'). 9. **Attach Original File**: Add a final **Xero** 'Upload an Attachment to a Document' module. Map the `Image/PDF URL` from Dext to attach the source receipt directly to the Xero invoice. 10. **Error Handling**: Right-click the Xero module and select 'Add error handler'. Use a 'Commit' or 'Ignore' directive combined with a notification module to ensure the scenario doesn't stop if one bill fails.

Data Mapping

| Dext Field | Xero Field | Transformation / Formula | Required | | :--- | :--- | :--- | :--- | | `Supplier Name` | `Contact` | `{{1.supplier_name}}` | Yes | | `Date` | `Date` | `parseDate(date; "YYYY-MM-DD")` | Yes | | `Invoice Number` | `Reference` | `{{1.invoice_ref}}` | No | | `Line items[]` | `Line Items` | Aggregated array via Iterator | Yes | | `Item Status` | `Status` | Default to `DRAFT` | Yes | | `Currency` | `Currency` | `{{1.currency_code}}` | Yes | | `Net Amount` | `Line Amount` | `{{item.net_amount}}` | Yes | | `Tax Code` | `Tax Type` | `switch(tax; "20% (VAT)"; "INPUT2"; "0%"; "NONE")` | Yes |

Gotchas & Failure Modes

* **Operation Quotas**: Iterating through many line items can consume operations quickly. Use 'Target Structure' aggregation to minimize API calls. * **Date Formatting**: Xero requires specific ISO formats. Always use the `formatDate()` function if Dext returns localized date strings. * **Duplicate Errors**: Xero will error if an `InvoiceNumber` already exists. Use a 'Search for Invoices' module beforehand to check for duplicates in Xero. * **Connection Timeouts**: Large file attachments can cause 'Gateway Timeouts'. Ensure files are under 10MB before passing them to the Xero 'Upload Attachment' module.

Verification Checklist

- [ ] **Test Run**: Click 'Run Once' with a specific Dext Item ID to ensure data flows to Xero correctly. - [ ] **Check Aggregator**: Verify that multi-line receipts appear as a single bill with multiple lines in Xero Drafts. - [ ] **Attachment Check**: Ensure the PDF preview appears in Xero and isn't a broken link. - [ ] **Filter Logic**: Submit a bill under $1,000 and verify it bypasses the approval Slack notification. - [ ] **History Logs**: Check the Make.com 'History' tab for any partial execution errors in the line-item mapping.

Ready to Automate?

Build this automation with Make.com in minutes.