Best answer

How to look up Shopify orders by SKU and format line items/descriptions in Google Docs?


Userlevel 2
Badge
  • Beginner
  • 16 replies

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?

icon

Best answer by christina.d 4 June 2022, 02:54

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

12 replies

Userlevel 7
Badge +14

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 2
Badge

 

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 +14

@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 2
Badge

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 +14

@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 2
Badge

@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 +14

@KWF 

These are options:

 

Userlevel 2
Badge

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 +14

@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 2
Badge

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 +14

@KWF 

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

 

Userlevel 7
Badge +9

Hiya @KWF! I wanted to pop in and summarize some of the responses here in the hopes it helps other users! It looks like this workflow may have done the trick along with some other tips from Troy.

Zap Steps

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

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

 

Here’s a few things that may help to read up on as well:

 

Hope this helps!