Hello,
I am using Shopify Flow in order to: Add line items to Google Sheets rows when a new order is placed
I managed to set it up, only one issue remains to solve. Everything is ok if the customer orders one products, because the system only generates one row in Google Sheets. But if the customer orders multiple products, each products gets its own row (so if 4 products are ordered, 4 rows). I only want one row per order.
The whole reason I created this gsheet, is for easier export to GLS, UPS etc. system, to print the shipping labels. And it’s really annoying if there are so many rows!
So the following columns need to have merged lines based on multiple products ordered (separated by comma):
1) Product SKUs
- so they are listed in the same field like: SKU1,SKU2,SKU3
2) Products - so they are listed in the same field like: product1,product2,product3
3) Quantities - so they are listed in the same field like: Q1,Q2,Q3
It looks like this right now (this is 1 order):
.
But I want it to look like this:
.
I tried this before, but the system gives ‘line_item error’:
- {{ order.line_items | map: ‘sku’ | join: ', ’ }}
- {{ order.line_items | map: ‘title’ | join: ', ’ }}
- {{ order.line_items | map: ‘quantity’ | join: ', ’ }}
.
And right now I have it like this (but like this each item from the order has its own row):
- {{lineItemsForeachitem.sku}}
- {{lineItemsForeachitem.variant.displayName | replace: ‘,’, ’ ’ }}
- {{lineItemsForeachitem.currentQuantity}}
My current code for the gsheet:
NEW_ORDER,{{ order.createdAt | date: ‘%Y-%m-%d %H:%M’ }},{{lineItemsForeachitem.sku}},{{lineItemsForeachitem.variant.displayName | replace: ‘,’, ’ ’ }},{{lineItemsForeachitem.currentQuantity}},{{ order.note }},{{ order.customer.firstName }} {{ order.customer.lastName }},{{ order.shippingAddress.address1 }},{{ order.shippingAddress.address2 }},{{ order.shippingAddress.zip }},{{ order.shippingAddress.city }},{{ order.shippingAddress.countryCodeV2 }},{{ order.customer.phone }},{{ order.customer.email }},{{ order.name }},{{order.fullyPaid}},{% for transactions_item in order.transactions %} {{transactions_item.gateway}} {% endfor %},Shopify,{{ order.createdAt | date: ‘%B’ }}
Thank you so much for your help!









