Question

Google Sheets into Xero with multiple rows with the same invoice number

  • 1 June 2023
  • 1 reply
  • 77 views

I have my invoice lines in Gsheet with Columns A & B being the Invoice Number and Date of the invoice, I am able to use line itemizer to get Columns C-G into Xero and that works, but I cannot get it to have an invoice per Invoice Number/Date, it either won’t import to Xero or import as a single invoice.

My current outline is New Spreadsheet Row (Team Drive) > Get Many Spreadsheet Rows (Advanced, output as Line Items) > Line Itemizer > Create Invoice

I have a screenshot of the google sheet please help!

 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +11

Hi @Small Pond, thanks for joining our Community here!

With the New Spreadsheet Row trigger, the Zap would run every time a new row is added, so you’d potentially end up with each new row creating a new invoice instead of adding it to the same invoice. Is that’s what’s happening here?

If yes, then perhaps you could use a Find Invoice along with a Add Items to Existing Sales Invoice (Xero) action to find the correct invoice and add the additional rows to it. You could use the Paths by Zapier app (Add branching logic to Zaps with paths) to carry out different actions based on whether the invoice was found or not (e.g. create the invoice or add items to it). But paths is only available on Professional plans and higher so depending on what plan you’re on this may not be an ideal solution.

Alternatively, you could achieve this using two separate Zaps:


Zap 1 - creates the invoice

  • Trigger: New Spreadsheet Row (Team Drive) runs when a new row is added.
  • Action: Find Invoice (Xero) searches for an existing invoice. The Should this step be considered a "success" when nothing is found? option is set to Yes so it won’t halt the Zap if nothing is found.
  • Action: Only continue if (Filter by Zapier) the _zap_search_was_found_status field is false (meaning it couldn’t find an existing invoice).
  • Action: Create Invoice (Xero) adds a new invoice if one isn’t found.

 

Zap 2 - updates the existing invoice

  • Trigger: New Spreadsheet Row (Team Drive) runs when a new row is added.
  • Action: Find Invoice (Xero) searches for an existing invoice. Set to halt the Zap if nothing is found.
  • Action: Only continue if (Filter by Zapier) the _zap_search_was_found_status field is true (it found an existing invoice).
  • Action: Add Items to Existing Sales Invoice (Xero) adds information from the new row to the existing invoice.

 

Hope that helps. If you run into any trouble with setting up those paths or separate Zaps, or if I’ve misunderstood the issue here please let us know! 🙂