How can I use Flow to add order rows to a Google sheet?

Topic summary

Main Issue:
Users want to export Shopify order line items to Google Sheets via Flow for dropship fulfillment, with each line item as a separate row (rather than Flow’s default one-row-per-order behavior).

Current Workaround:

  • Use delimiters (“##” for rows, “::” for columns) in Flow to concatenate line items
  • Apply a Google Apps Script in Sheets to split the delimited data into separate rows
  • A sample script was shared that processes the delimiter-separated values

Common Problems & Solutions:

  • Extra blank rows: Caused by trailing “##” delimiter. Fix using {% unless forloop.last %}##{% endunless %} in Flow
  • Unwanted columns from commas: Product titles with commas create extra columns. Solution: use | replace: ',', '' filter in Flow to remove commas from fields
  • “Loading Error” in Sheets: Occurs intermittently when the script runs; requires manual cell refresh. Likely a Sheets bug with no clear fix
  • Script triggering: The onEdit trigger for automatic execution when Flow adds rows remains problematic for some users

Recent Development:
Flow now supports “For Each” loops, allowing users to call the Sheets action for each line item directly without custom scripting—a simpler alternative to the delimiter method.

Status: Discussion remains open with ongoing troubleshooting questions about script implementation and Flow-to-Sheets connectivity.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

To output the delimiter except on the last item you could replace ## with:
{% if forloop.last %}{% else %}##{% endif %}

You might also be able to write, but I haven’t tested:
{% unless forloop.last %}##{% endunless %}

1 Like