Back to ERPNext in Google Sheets
SheetXAI logo
ERPNext logo
ERPNext · Google Sheets Guide

Bulk-Generate ERPNext Sales Invoices From a Sheet of Sales Order IDs

2026-05-13
4 min read
See the Excel version →

The Scenario

You are an accounts receivable clerk. It is Tuesday at 9 AM and your billing run is due by noon. You have 40 confirmed Sales Orders in a Google Sheet — the order IDs in column A, verified by the sales team on Monday. Each one needs to become an ERPNext Sales Invoice.

The way you have been doing this: open ERPNext, search for each Sales Order ID, click "Create Invoice," review the auto-populated fields, submit, copy the invoice ID, paste it back into the sheet. Then move to the next row. Forty times.

At roughly four minutes per order, that is two hours and forty minutes of clicking before you even look at the invoices.

The bad version of billing day:

  • Open ERPNext Sales Order list, search for first order ID
  • Click "Create Invoice," verify the line items pre-populate
  • Submit the invoice
  • Copy the new Sales Invoice ID, paste it into column B of the sheet
  • Navigate back, find the next order ID
  • Repeat 39 more times
  • It is 12:30 and you have missed the billing deadline.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI reads your Sales Order ID column and creates all 40 invoices through the ERPNext API, writing each returned Invoice ID back to the sheet so you have a record.

Open the SheetXAI sidebar and type:

Create an ERPNext Sales Invoice from each Sales Order ID in column A of this sheet. Write the new Invoice ID into column B for each row. If creation fails for a row, write the error reason into column B instead.

SheetXAI iterates through all 40 rows, calls ERPNext's API to create each Sales Invoice from the referenced Sales Order, and writes the result into column B. The whole run takes minutes, not hours. You spend the time reviewing the invoices, not creating them.

What You Get

A completed sheet with 40 rows of invoice confirmation:

  • Successful rows — the new ERPNext Sales Invoice ID in column B
  • Failed rows — the specific error in column B (wrong status, missing customer account, already invoiced)
  • Full audit trail — the source Sales Order ID in column A paired with the resulting Invoice ID in column B

You can copy column B directly into your follow-up report. No manual reconciliation against ERPNext's invoice list. The sheet is the record of the billing run.

For failed rows, fix the issue in ERPNext (or correct the order ID in the sheet) and re-run the prompt for just the rows with errors in column B.

What If the Data Is Not Quite Ready

Billing runs rarely have perfectly clean input. SheetXAI handles the variations inline.

When some order IDs in the sheet are formatted inconsistently

Some IDs have leading zeros, some do not. Some have spaces. ERPNext won't find them.

Normalize the Sales Order IDs in column A by removing leading and trailing spaces. Then create an ERPNext Sales Invoice for each ID and write the Invoice ID into column B.

When some orders may already be invoiced

The sales team occasionally adds IDs that were invoiced last week. You need to skip those instead of creating duplicate invoices.

For each Sales Order ID in column A, check whether an ERPNext Sales Invoice already exists for that order. If it does, write "ALREADY INVOICED" into column B and skip. If not, create a new Sales Invoice and write the Invoice ID into column B.

When you need the invoice amount written back too

Finance needs column B for the Invoice ID and column C for the invoiced total for the cash-flow forecast.

Create an ERPNext Sales Invoice for each Sales Order ID in column A. Write the new Invoice ID into column B and the total invoice amount into column C. If creation fails, write the error into column B and leave column C blank.

When the sheet has notes about billing exceptions and you need to skip flagged rows

Some rows in the sheet have "HOLD" in column C, meaning do not invoice yet.

Skip any row where column C contains "HOLD." For all other rows, create an ERPNext Sales Invoice from the Sales Order ID in column A. Write the Invoice ID into column B. Write "SKIPPED — HOLD" into column B for the rows you skipped.

The pattern: the prompt handles the conditional logic. You describe the exception and SheetXAI applies it across every row without you building a filter first.

Try It

Get the 7-day free trial of SheetXAI and run it against your next billing queue. The ERPNext integration is included in every SheetXAI plan. For other AR and AP workflows, see how to pull unpaid Purchase Invoices for AP review or the ERPNext in Google Sheets overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more