Skip to main content

Hi, I am using Zapier to pull orders from Shopify and add order details to a Google Sheet. I set up a filter to only pull orders that include a specific SKU, “Custom_TheClassic”. I would like to pull the quantity purchased of this SKU, but when there are multiple products on the order then the the Line Item Quantity field shows the quantity of each item separated by a comma. 

How can I pull out quantity of a specific SKU and add it to a column?

Hi @rachred_ 

You can use Looping to iterate thru the Shopify Order Line Items: https://zapier.com/apps/looping/help

Add a Filter step within the Loop: https://zapier.com/apps/filter/help

Map the variables from the Looping step to the GSheet step.


Thanks Troy. After creating the loop, how should I set up the filter so that only the quantity for the SKU matching “Custom_TheClassic” will map to the GSheet?

 


@rachred_ 

A  Filter step condition: {{SKU}} contains Custom_TheClassic

{{SKU}} would be mapped from the Looping step

“contains” is the middle operator dropdown selection.

“Custom_TheClassic” (without parenthesis is a static value)

Post screenshots with how you have your Filter step configured.


This does not seem to be working. The “Total Paddle Qty” should be just showing 2 instead of 1,2 if it it properly ignoring the quantity for SKUs other than “Custom_TheClassic”.

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.


@rachred_ 

For us to have more context, post screenshots with how your Zap step 6 and step 8 are configured in EDIT mode.


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.


@rachred_ 

Looping help article: https://zapier.com/apps/looping/help

 

You need to fix the mapped variable from the Looping step as per the instructions from the help article.

  • You must not use the preview_loop_values field from the loop test in your Zap. It is for preview purposes only and does not appear in actual Zap runs.

 


 

 

I switched to the “Quantity” field and now the output is 1, which is the quantity for the SKU “HybridPickleballs_Green” and not “Custom_TheClassic”

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.


@rachred_ 

For the filter step, it is checking for the SKU value “HybridPickleballs_Green” and indicates the Filter step would not have passed because the Filter conditions are not met.

 

Help article for using the Looping app: https://zapier.com/apps/looping/help

Indicates the following:

  • When you test this action, the Zap will only create the first loop.
    It will not create any other loops during the test.

 

You will need to turn the Zap ON and test live to see how each Loop iteration is handled.

 


Hi @rachred_  Did you manage to get it done? Would you like me to provide you with some code (using a slightly different flow)?