Question

How Do I Pull Single Product Info Into Google Sheet from A Huge Shopify Order?


Userlevel 1

Hey guys,

 

I was wondering how you would solve this task that I’m struggling with:

 

I want Zapier to scan every new paid order, match it with the correct SKU/Product Name/ Product ID, and then ONLY pull that product information (such as customer info, address, etc) with the paid order info, and input that  into a Google Sheet Row.

 

Essentially is it possible to create a zap that exports orders in Shopify that contain a specific product ID into a Google Sheet, containing the customer name, email, order date, order number, order line item?

 

I’ve basically figured everything out BESIDES how to get Zapier to correctly input that specific data into Google Sheets. This works really well if it’s only one product being purchased, if it’s a multi-product order, then Zapier will have trouble.

 

Zapier pulls all info correctly, but isn’t the right product/SKU.

My Zap goes like this:

Trigger: Shopify Paid Order

 

Action: Filter by Line Items Sku - Only Continue If Text Contains (Line Items Sku)

 

Action: Create SpreadSheet Row 

 

OR

 

Trigger: Shopify Paid Order

 

Action: Filter by Line Items Name - Only Continue If Text Contains (Line Items Name)

 

Action: Create SpreadSheet Row 

 

Line Items Name, SKU, and PRODUCT ID don’t pull the correct product info.

 

Yes, I’m already using Filter by Zapier. 

 

Is it even possible for Zapier to Filter a single product from a multi-product order AND input it into Google Sheets? Please advise and thank you very much!

 


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

Hi @UMS Ecommerce 

 

You can do that using Looping by Zapier which will then basically loop through the line items and create a separate row for each one

Userlevel 1

Hi @UMS Ecommerce 

 

You can do that using Looping by Zapier which will then basically loop through the line items and create a separate row for each one

Thanks for the reply!

The problem is, the Zap is only half-working.

I went ahead and tried the loop and it’s finally pulling the correct information (using Line Item SKU), but it’s looping and pulling TOO much information now.

Check it out here:

In a single Zap action, it’s input the same information 4 TIMES.

 

It’s pulling the right info, but it’s looping far too many times. I have the filter on it as well.

Here’s the set-up:

 

LOOP SETTINGS
FILTER SETTINGS

I’m only trying to pull a single product from a big order so that I can send it over to my supplier. My end-goal is to have Zapier go through every paid order, find the right SKUs that I give it, input it into a spreadsheet, and have my supplier fulfill through the spreadsheet. It’ll save me so much more time.

 

What should I do now?

Userlevel 7
Badge +8

Hi @UMS Ecommerce 

 

Sorry for the late reply. 

 

As a start, the filter is a problem because you are passing the same value over and over, basically you are saying if 1 = 1 then continue, which will always be true. 

 

If there is a set of SPECIFIC SKUs you want to work with then you have few options:

 

  1. In the filter you have to add all the SKUs (actually type it, not map the value, so the box below would become TD-3021B instead of a dynamic item. You can then add the other values with the OR condition. 

 

Another option would be to add INSIDE the Loop a Lookup table (Formatter by Zapier > Utilities > Lookup Table). In this table you will input the “Lookup Key” as the Line Item SKU and then on the left just type 1 and on the right type the different SKUs (all in different lines). The fallback value would be 0. Then add a filter where it will continue only if the value is 1. 

 

Let me know how this goes

Userlevel 7
Badge +9

Hey @UMS Ecommerce how are things going here? Were you able to move forward with Moh’s suggestions? Keep us posted - we want to make sure you’re set up for success here!

Userlevel 1

Works perfectly now!

 

All I had to do was add the loop so Zapier can read through all the data in a Shopify paid order, then filter by SKUs (typing out the SKUs, not using the line items) and it’s worked out perfectly the last two weeks. 

Thank you Moh!

Userlevel 1

On second thought, it seems that Zapier is still looping too many times.

 

It isn’t looping as much, but it is still looping one too many.

 

I’ve set the loop iteration from 10 to 5 to seem if that helps.

 

 

Also, to double check, the right side of VALUES TO LOOP is only for the FIELD that I want Zapier to read through? For ex. here I have it set to line item SKUs, which means the is the FIELD / DATA I want Zapier to read through?

 

Thank you again!

Userlevel 7
Badge +11

Hey @UMS Ecommerce! 👋

Sorry to hear the Zap is still creating too many rows in Google Sheets. I wonder if changing the Create Spreasheet Row action to a Lookup Spreadsheet Row action might help to prevent that. With the Lookup Spreadsheet Row action, it has the ability to create a new row if an existing match isn’t found.

And it has the ability to set a supporting lookup column and value to search for. So in theory you could get it to look for a match on the Order Number as well as the SKU. That way you should only end up with one row added per order for each of the different SKUs. Hopefully that helps! 🙂

Userlevel 7
Badge +12

Hi @UMS Ecommerce!

The maximum number of loop iterations shouldn’t matter as the Zap will run through however many line items it finds that match the data, so I don’t think that’s the issue. 

To double-check, the right side of VALUES TO LOOP is only for the FIELD that I want Zapier to read through? For ex. here I have it set to line item SKUs, which means the is the FIELD / DATA I want Zapier to read through?

In the Looping action, the Values to loop are the values that will come through for each loop. If you’re using the Create Loop From Line Items action, the Zap will run the loop for as many times as there are line items. For example, in the looping test below, you can see that there were two iterations of the loop and for each loop the name and field description were included in the data

One thing that sometimes catches people up when using Looping is which field to put into the next step. Don’t use the ‘Preview Loop Values’ field, use the field name - in the example below that would be Name and Description and not the Preview loop value options.  

 

Could you include a screenshot of the Google Sheets step so we can see how that is set up? Also, are you able to show us the shopify data for the examples where it looks like the data has been added twice? Don’t forget to remove or obscure any personal or private information in any screenshot you share in the community (eg full name, email address, etc).

 

Hopefully we’ll be able to get to the bottom of things with a bit of extra information 😊

Userlevel 1

Hey @UMS Ecommerce! 👋

Sorry to hear the Zap is still creating too many rows in Google Sheets. I wonder if changing the Create Spreasheet Row action to a Lookup Spreadsheet Row action might help to prevent that. With the Lookup Spreadsheet Row action, it has the ability to create a new row if an existing match isn’t found.

And it has the ability to set a supporting lookup column and value to search for. So in theory you could get it to look for a match on the Order Number as well as the SKU. That way you should only end up with one row added per order for each of the different SKUs. Hopefully that helps! 🙂

 

This post has been edited by a moderator to remove personal information. Please remember that this is a public forum and to remove any sensitive information prior to posting.

Interesting. I think I may try to give that a shot, though it may take me awhile to collect data on it.

Thank you! 

I will update if this works out.

 

 

Hi @UMS Ecommerce!

The maximum number of loop iterations shouldn’t matter as the Zap will run through however many line items it finds that match the data, so I don’t think that’s the issue. 

To double-check, the right side of VALUES TO LOOP is only for the FIELD that I want Zapier to read through? For ex. here I have it set to line item SKUs, which means the is the FIELD / DATA I want Zapier to read through?

In the Looping action, the Values to loop are the values that will come through for each loop. If you’re using the Create Loop From Line Items action, the Zap will run the loop for as many times as there are line items. For example, in the looping test below, you can see that there were two iterations of the loop and for each loop the name and field description were included in the data

One thing that sometimes catches people up when using Looping is which field to put into the next step. Don’t use the ‘Preview Loop Values’ field, use the field name - in the example below that would be Name and Description and not the Preview loop value options.  

 

Could you include a screenshot of the Google Sheets step so we can see how that is set up? Also, are you able to show us the shopify data for the examples where it looks like the data has been added twice? Don’t forget to remove or obscure any personal or private information in any screenshot you share in the community (eg full name, email address, etc).

 

Hopefully we’ll be able to get to the bottom of things with a bit of extra information 😊

 

Absolutely! I already have it set at line items SKU, I don’t see the Loop ID version for that. 

Here are my screenshots to see if you can better help me.

I have my Google Spreadsheet event set to: “Create SpreadSheet Row”

Maybe the loop is just looping this event? I don’t believe that is how it would work, but something is definetly looping one too many times.

 

 

And here are my updated sheets, without the censors and blurs. 

 

Thank you and looking forward to your inputs.

Userlevel 7
Badge +11

Thanks for getting back to us with those helpful screenshots, @UMS Ecommerce

Ah, it doesn’t look like the Google Sheets action is taking any values from the loop so that’s likely why it’s using the same SKU values for each run of the loop. You’d need to select any parts of line item fields that would be unique for each row from the Looping by Zapier action, not the Shopify trigger.

So for example if the SKU should be different but the rest of the information for the row would be the same then you’d select just the SKU field from the Looping by Zapier action. And the rest of the Shopify fields would remain selected. Like so:
3f9033a87cbd40ac01a4cee6fd788901.png

Can you try selecting the SKU value from the loop instead and see if that fixes it?

Userlevel 1

Thanks for getting back to us with those helpful screenshots, @UMS Ecommerce

Ah, it doesn’t look like the Google Sheets action is taking any values from the loop so that’s likely why it’s using the same SKU values for each run of the loop. You’d need to select any parts of line item fields that would be unique for each row from the Looping by Zapier action, not the Shopify trigger.

So for example if the SKU should be different but the rest of the information for the row would be the same then you’d select just the SKU field from the Looping by Zapier action. And the rest of the Shopify fields would remain selected. Like so:
3f9033a87cbd40ac01a4cee6fd788901.png

Can you try selecting the SKU value from the loop instead and see if that fixes it?

 

Hey Sam,

I just tried doing what you suggested but there isn’t an option for SKU values in the Google Sheets action from the loop metrics.

 

SKU option missing from values.
My loop number is at step 2, rather than the screenshot you provided which is at 3.

 

Thanks for helping me solve this, I really appreciate your help.

Userlevel 7
Badge +11

Sorry to hear the SKU is missing, @UMS Ecommerce. Was it added as one of the values to loop from? 

If not, you’ll want to add it in as one of the values in the Values to Loop section like so: 
e5070c3d656b0a243372b4197faaa4b8.png
Then it should become available to select in subsequent actions, for example:
330668e5eebb698457e8c43d229597af.png
After adding it you’ll need to then retest the Looping by Zapier action to make sure it outputs a field called SKU. Before trying to select the SKU field in the Google Sheets action again.

Looking forward to your reply! 🙂