How can I automate total stock order quantity for each SKU?

{% for getOrderData_item in getOrderData %} {% for lineItems_item in getOrderData_item.lineItems %} {{lineItems_item.sku}} - {{lineItems_item.quantity}} {% endfor %} {% endfor %}

It is working but we want combined stock. Like how many stock of one sku in total orders.

the current code is printing.

Example:

sku1= 1

sku2= 2

sku1 = 1

sku2=4

what we want:

sku1=2

sku2=6

This is something that liquid it not very good at. You would need to create a variable for each sku encountered and then output that variable at the end.

Can you elaborate more on how you are looking to use this data as there might be other options? You could instead stream the data to Google Sheets and use that to aggregate the quantities, for example.

I want SKUs along with their sales displayed. Is there any way I can automate the process of streaming data to Google Sheets using an app ?

Yeah, that’s a common use of Flow. You might start by clicking “browse templates” and search for sheets