Add row to spreadsheet - Comma issue

Add row to spreadsheet - Comma issue

bjornbjornbjorn
Tourist
9 0 4

I have an issue where I want to add the title of a product to google sheet. However, some product names have commas in the title, which are separated in different rows in the spreadsheet. 

 

Row content section looks like this now:

 

{{product.distributor.value}},{{productVariant.product.title}},{{productVariant.title}},{{productVariant.sku}},{{productVariant.barcode}},{{productVariant.inventoryQuantity}},{{product.minimumLagerbeholding.value}},{{product.onlineStoreUrl}},

 

It works nicely when products doesn't have commas in the name, but when it does, the whole spreadsheet gets messed up. 

 

How can I sort this? Thank you!

Replies 2 (2)

PaulMartin
Shopify Partner
443 52 106

Encase the names in double quotes to keep it from breaking your csv.

Contact here for WhatsApp | Email
$20 start rate for theme fix & customization
Don't forget to like and mark as solution

bjornbjornbjorn
Tourist
9 0 4

I couldn't get it to work with double quotes, but I found another thread here and the solution was this:

 

{{productVariant.product.title | replace: ',', '\,' }}