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.

You shouldn’t need to change this except the delimiters if you use something else.

function result(range) {
  //range is a list of rows
  row_delimiter = "##"
  col_delimiter = "::"
  col_split_index = 1  //this is the column to do the split on

  //get number of columns in the split
  //var split1 = range[0][col_split_index].split(row_delimiter);
  //var num_col_split = split1.split(col_delimiter).length;

  var output = [];   

  //loop over the rows
  for(var r=0, rLen=range.length; r
1 Like