Question

How can I look up a Shopify order by SKU and format line items and descriptions in Google Docs?


Userlevel 1

Hello Guys,

 

So I was wondering how do I go about this task:

I want Zapier to look into new Shopify orders, lookup an SKU, and match it with a google sheet file, I then want to format certain line Items as well as a Product Description from the Google sheet file from that order and place them in a Google Docs file like this:

ORDER no: lineitem [] Order

Customer Information:

First Name: lineitem [] First Name

Last Name: lineitem [] Last Name

 

Order Details:

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor line Items [] Product Title [description from Google Sheets]

 

This is all good if I only have one item being ordered but if I have multiple items then it does not look great, what I wanted is to have something like this:

 

ORDER no: lineitem [] Order

Customer Information:

First Name: lineitem [] First Name

Last Name: lineitem [] Last Name

 

Order Details:

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor line Items [] Product Title [description from Google Sheets]

 

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor line Items [] Product Title [description from Google Sheets]

 

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor line Items [] Product Title [description from Google Sheets]

 

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor line Items [] Product Title [description from Google Sheets]

 

So based on the number of items in the order it will create grouped QTY SKU AND DESC lines. Is this even possible? I tried using line Itemizer as well as text to line items and it seems to just show them separated with commas and shows it as a single line. Can anyone please help?


11 replies

Userlevel 7
Badge +13

Hi @KWF 

Good question.

Perhaps consider approaching the solution like this…

Looping app can be used to handle 1+ line items: https://zapier.com/apps/looping/help

And use the GDoc Append Text to Doc action step in the Zap loop.

 

Zap Steps

(something like this)

  1. Trigger: Shopify New Order
  2. Action: GDoc Create Doc from Template
    1. Use for the consistent Order/Customer info at the top
  3. Action: Looping
  4. Action: GSheet - Lookup Row
  5. Action: GDoc - Append Text to Doc
Userlevel 1

 

Hi @KWF 

Good question.

Perhaps consider approaching the solution like this…

Looping app can be used to handle 1+ line items: https://zapier.com/apps/looping/help

And use the GDoc Append Text to Doc action step in the Zap loop.

 

Zap Steps

(something like this)

  1. Trigger: Shopify New Order
  2. Action: GDoc Create Doc from Template
    1. Use for the consistent Order/Customer info at the top
  3. Action: Looping
  4. Action: GSheet - Lookup Row
  5. Action: GDoc - Append Text to Doc

 

 

If we disregard the Google sheet lookup process and just go with the Formatter function Line Itemizer:

Trigger - New Order

Formatter - Line Itemizer

Google Docs - with these:

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor || line Items [] Product Title

QTY: lineitems []qty

SKU: Line Items [] sku

Desc: Line Items [] vendor || line Items [] Product Title

 

at the moment I have formatter like so:

But when I look at the Google docs out put after click Test Action it still shows it as 

 

QTY: 1,1,1,1

SKU: SKU1, SKU2, SKU3, SKU4

DESC: Vendor1, Vendor2, Vendor3, Vendor4 Product Title1, Product Title2, Product Title3, Product Title4

 

I really don’t get why it is stil not showing it properly or am I doing it wrong.

Userlevel 7
Badge +13

@KWF 

Test the Formatter step and review the output, that will help you understand why the line items aren’t being formatted properly.

 

Did you give this suggested approach a try?

 

Zap Steps

(something like this)

  1. Trigger: Shopify New Order
  2. Action: GDoc Create Doc from Template
    1. Use for the consistent Order/Customer info at the top
  3. Action: Looping
  4. Action: GSheet - Lookup Row
  5. Action: GDoc - Append Text to Doc
Userlevel 1

Have been digging through files of tutorials only to find this article after a few hours of checking things where I might have been wrong.

 

 

Looks like Zapier does not support Line Items on Google Docs, unlike Google Sheet which can do Rows of Data from a specific Order number. Why wasn’t this mentioned earlier? Also, the extra step for Google Sheet lookup is not really a requirement for the task automation I plan on making. What’s really important is the Automation of grouping all the Order details SKU, Product Title, Qty, and Vendor and making it a line item array that goes to a Google Docs file that I can then send as an attachment to a supplier.

 

So to clarify are line Items still not supported by Google Docs directly?

Userlevel 7
Badge +13

@KWF 

While GDocs doesn’t support line items, you can work with line items using the Looping app: https://zapier.com/apps/looping/help

 

 

Have you given this Zap configuration a try?

 

Zap Steps

  1. Trigger: Shopify New Order
  2. Action: GDoc - Append Text to Doc
    1. Use for the Order/Customer info
  3. Action: Looping
    1. THIS HANDLES THE LINE ITEMS
  4. Action: GDoc - Append Text to Doc
    1. Use for the Line Item info
Userlevel 1

@KWF

While GDocs doesn’t support line items, you can work with line items using the Looping app: https://zapier.com/apps/looping/help

 

 

Have you given this Zap configuration a try?

 

Zap Steps

  1. Trigger: Shopify New Order
  2. Action: GDoc - Append Text to Doc
    1. Use for the Order/Customer info
  3. Action: Looping
    1. THIS HANDLES THE LINE ITEMS
  4. Action: GDoc - Append Text to Doc
    1. Use for the Line Item info

 

Append text to Doc requires an existing Document. I need to create a new document that is based on the  recent order

So I need Google Doc Action as

Create Document from Text. 

 

Is there a way to do that?

Userlevel 7
Badge +13

@KWF 

These are options:

 

Userlevel 1

Not sure if this will work I am really new to Zapier so bear with me:

 

Trigger: 

ACTION 1 GDOCS - CREATE DOCUMENT

ACTION 2: CREATE LOOP



ACTION 3 APPEND TEXT TO DOCUMENT

 

Userlevel 7
Badge +13

@KWF

When in doubt, test it out!

Turn the Zap ON, test, then check your results.

For troubleshooting, check your Zap Runs to see the DATA IN/OUT for each Zap step: https://zapier.com/app/history/

 

TIP: You may want to add static labels so indicate each value for added context.

 

Userlevel 1

Is there a way I can control where the Text will be Added if I use the option Append Text to Document?

Userlevel 7
Badge +13

@KWF 

The GDoc Append Text to Doc will append data at the end of the existing document.

 

Reply