Skip to content

Set Up the Flow

Create a record-triggered flow that runs when Send to Xero is ticked, then add the elements that every version of the flow needs: the invoice mapping and the Xero organisation.

Navigate to Setup > Flows and click New Flow.

The Flows list in Setup with the New Flow button highlighted

Select Record-Triggered Flow.

The New Automation dialog with Record-Triggered Flow highlighted under Frequently Used

In the Configure Start panel, set up the trigger:

  • Object — Opportunity.
  • Trigger the Flow When — A record is updated.
  • Condition Requirements — All Conditions Are Met (AND), with Send to Xero Equals True.
  • When to Run the Flow for Updated Records — Only when a record is updated to meet the condition requirements, so the flow runs once when the box is ticked rather than on every later edit.
  • Optimize the Flow for — Actions and Related Records.
  • Add Asynchronous Path — on.

The Configure Start panel with the Send to Xero Equals True condition and the Add Asynchronous Path toggle outlined, and the Run Immediately and Run Asynchronously paths on the canvas

On the Run Asynchronously path, click +, select Get Records and set it up to find the invoice mapping:

  • Label — Get Invoice Mapping.
  • Object — Xero Mapping.
  • Filter — Mapping Type Equals Invoice, and Xero Mapping Name Equals the name of your mapping, for example Standard Sales.
  • How Many Records to Store — Only the first record.

The Get Invoice Mapping element filtering Xero Mapping records by Mapping Type Invoice and Xero Mapping Name Standard Sales

Below it, add another Get Records element to find the Xero organisation the mapping belongs to:

  • Label — Get Xero Tenant.
  • Object — Xero Tenant.
  • Filter — Record ID Equals Get Invoice Mapping > Xero Tenant.

The Get Xero Tenant element filtering Xero Tenant records by Record ID equal to the invoice mapping's Xero Tenant

Click Save and enter a Flow Label, for example Create Xero Invoice from Opportunity.

The rest of the flow depends on how the invoice gets its Xero Contact. Choose one option: