Automate Google Sheets Order Item Splitting with Apps ScriptAutomate Google Sheets Order Item Splitting with Apps Script
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Stop manually splitting order line items in Google Sheets.
Our order export puts every SKU for an order into one cell, like “A249,A231,A238,A236,A232”. To get usable item-level data (one row per product, with name and price), someone had to split, look up, and copy-paste by hand.
So I automated it with a small Google Apps Script. It adds an “Add Items” menu to the sheet, and one click turns the Orders sheet into a clean Items sheet:
→ Splits the comma-separated SKUs → Looks up each product’s name and price from the Inventory sheet → Writes one row per item, keeping the order date, ID, state, country, and pin → Marks each order as “Done” so it never gets processed twice
A few design choices I’m happy with:
🔹 Inventory is loaded into a Map once. Lookups are instant, instead of searching the sheet for every SKU.
🔹 No half-processed orders. If any SKU in an order is missing from Inventory, the whole order is skipped and the status shows exactly which SKUs are the problem (“Missing SKU: A999”). Fix the inventory, run it again, and it picks up where it left off.
🔹 Bulk writes only. All rows and statuses are written in two operations instead of cell by cell, so it stays fast as the data grows.
🔹 Safe to re-run. Orders with an existing status are skipped, so there’s no risk of duplicates.
In my test run, 9 orders became 22 clean item rows in a couple of seconds, with no copy-paste and no typos.
The lesson: you don’t need a big system to remove a repetitive task. Sometimes 80 lines of Apps Script is enough to give someone back their Friday afternoon.
What’s the most tedious spreadsheet task you’ve automated? 👇
#GoogleSheets #GoogleAppsScript #Automation #Ecommerce #Productivity #NoCode #Spreadsheets
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started