QuvanticBook free audit

ZapierChecked blueprint5 nodes

Write each Shopify line item to its own sheet row

Split a Shopify order into one sheet row per product, after a Code step confirms the comma-joined line items still line up.

Portfolio reference build with demo data and placeholder credentials, not a client deployment.

Pain

Kills the CSV between the store, the sheet, accounting, and the VIP Slack alert.

Solution

Split a Shopify order into one sheet row per product, after a Code step confirms the comma-joined line items still line up.

Impact · From the blueprint

About 2 minutes per multi-item order compared with copying lines by hand; for 40 orders a week that is over an hour.

Library status: passing. Schema, field mapping, task count, and Code-step unit tests pass. Not built in a live Zapier account.

Write each Shopify line item to its own sheet row step list
Step list

Step inspector

The first step shows the checked-in sample payload.Later steps name the node. They are not a live execution.

Guardrails

  • Filter by Zapier · Only continue if...

Credential ids in the JSON are placeholders. These files are portfolio demos.

Deploy this for your business

Tell us this slug and what still happens by hand. We will map it onto your accounts. This page is not a claim that the blueprint already runs for a customer.

README

Portfolio demo by Mustafa (mustafaautomation). Not client work. The people, companies, and numbers in it are made up. Rebuild it in your own Zapier account. Nothing here is connected to anyone's account.

Category: E-commerce
Difficulty: advanced
Apps: Shopify, Code by Zapier, Filter by Zapier, Looping by Zapier, Google Sheets
Zapier plan: Professional (multi-step Zap: 4 steps after the trigger; Filter by Zapier; premium app: Shopify)
Tasks per run: 2
Test status: passing (schema, mapping scope, task count, Code step unit tests)

Problem

The production sheet needs one row per product (SKU, quantity, price), but Zapier hands over a multi-product order as comma-joined lists. A product title with a comma in it ("Mug, large") shifts every later column and the sheet quietly records the wrong SKU against the wrong quantity.

Who it's for

Makers and small brands that plan production or pick lists from a Google Sheet rather than an inventory system.

How the Zap runs

flowchart TD
  s1["1. Shopify: New Order<br/>New order"]
  s2["2. Code by Zapier<br/>Check the line items line up"]
  s1 --> s2
  s3{{"3. Filter by Zapier<br/>Only orders whose lists line up"}}
  s2 --> s3
  s4["4. Looping by Zapier<br/>Loop over the line items"]
  s3 -->|"passes"| s4
  s5["5. Google Sheets<br/>Add one row for this product"]
  s4 --> s5

Build it in the Zapier editor

Zapier has no import file for a Zap like this one, so it is built by hand from the steps below. zap.json is the same Zap in a machine-readable form (schema), and zap.yaml is the same document in YAML.

A value like [2. vendor] means: click the field, open step 2 in the data picker, and choose vendor. Plain text is typed as shown. YOUR_... is a value from your own account.

Before you start

  • Create the sheet Production › Order lines with these headers in row 1: order_number, ordered_at, line, sku, product, quantity, unit_price, order_subtotal.
  • Have these ready from your own accounts: YOUR_STORE.

Steps

1. Trigger: New order

App: Shopify · Event: New Order · instant (the app pushes each event to Zapier) · Tasks: 0

Fires on every new order, paid or not, because production planning starts at checkout.

FieldValue
StoreYOUR_STORE

Fields this library maps from the trigger: id, order_number, email, line_item_titles, line_item_quantities, line_item_prices, line_item_skus, currency, created_at. Zapier shows them with its own labels; pick the one with the same meaning.

2. Action: Check the line items line up

App: Code by Zapier · Event: Run JavaScript · Tasks: 1

Counts the comma-joined lists and reports mismatch when a title with a comma has broken the join, before any row is written.

Paste the whole of code/line-items.js into the code box. Source: content/code/line-items.cjs. Unit tests: content/code/line-items.test.cjs.

Input Data keyValue
titles[1. line_item_titles]
quantities[1. line_item_quantities]
prices[1. line_item_prices]
skus[1. line_item_skus]
currency[1. currency]

Returns: line_count, unit_count, subtotal, summary, missing_skus, mismatch.

3. Filter: Only orders whose lists line up

App: Filter by Zapier · Event: Only continue if... · Tasks: 0

A mismatched order stops here instead of writing shifted rows. Fix the product title in Shopify and re-run the order.

Only continue if: [2. mismatch] (Boolean) Is false.

Most runs pass this filter.

4. Action: Loop over the line items

App: Looping by Zapier · Event: Create Loop From Line Items · Tasks: 0

Runs the next step once per product. Each key below becomes a field inside the loop.

FieldValue
Values to Loop › title[1. line_item_titles]
Values to Loop › quantity[1. line_item_quantities]
Values to Loop › price[1. line_item_prices]
Values to Loop › sku[1. line_item_skus]
Maximum number of loop iterations50

Later steps can map: loop_iteration, loop_iteration_is_last, title, quantity, price, sku.

5. Action: Add one row for this product

App: Google Sheets · Event: Create Spreadsheet Row · Tasks: 1

Runs once per line item, so an order with four products writes four rows.

FieldValue
DriveMy Google Drive
SpreadsheetProduction
WorksheetOrder lines
Columns › order_number[1. order_number]
Columns › ordered_at[1. created_at]
Columns › line[4. loop_iteration]
Columns › sku[4. sku]
Columns › product[4. title]
Columns › quantity[4. quantity]
Columns › unit_price[4. price]
Columns › order_subtotal[2. subtotal]

Later steps can map: id, row_number.

Test it

Use sample-trigger.json as the test record. For an instant or webhook trigger, send it to the trigger once; for a polling trigger, create a matching record in the app and click Test trigger. Then test each step in order and read its output before you turn the Zap on.

{
  "id": "5839207712456",
  "order_number": "1192",
  "email": "jonas.weber@alpenrose-cafe.example",
  "line_item_titles": "Linen apron,Stoneware mug,Walnut serving board",
  "line_item_quantities": "2,6,1",
  "line_item_prices": "24.00,12.10,92.00",
  "line_item_skus": "APR-01,MUG-07,BRD-12",
  "currency": "USD",
  "created_at": "2026-11-24T09:31:02Z"
}

Plan and task usage

StepAppTasks
1. New orderShopify0
2. Check the line items line upCode by Zapier1
3. Only orders whose lists line upFilter by Zapier0
4. Loop over the line itemsLooping by Zapier0
5. Add one row for this productGoogle Sheets1

A typical run uses 2 tasks. Zapier does not charge tasks for triggers, Filter, Paths, Formatter, Delay, Looping, Digest, Storage, or Zapier Tables steps. AI by Zapier is counted here as 1 task; Zapier prices it by model tier, so a larger model can cost more.

Minimum plan: Professional, because of: multi-step Zap: 4 steps after the trigger; Filter by Zapier; premium app: Shopify. The Free plan only runs two-step Zaps (a trigger and one action) and leaves out Filters, Paths, Formatter, webhooks, AI by Zapier, and premium apps.

Customize

  • Map [2. summary] into a Slack message after the loop if you also want a readable pick list in a channel.
  • Lower the iteration cap if you never sell more than a handful of products per order; it bounds task use on a malformed order.

Limits

  • The task count shown is for one line item. The sheet step runs once per product, so a four-product order uses 1 + 4 tasks.
  • Products whose title contains a comma always trip the mismatch filter. Renaming them ("Mug - large") is the fix.
  • Shopify is a premium app on Zapier.

Time saved

About 2 minutes per multi-item order compared with copying lines by hand; for 40 orders a week that is over an hour.

Files

FileWhat it is
zap.jsonThe Zap, step by step, in schema 1.0.0.
zap.yamlThe same document in YAML.
sample-trigger.jsonFictional trigger record for the first test.
diagram.pngThe step list, drawn like the Zapier editor.
code/line-items.jsPaste-ready Code by Zapier step.