Get line items (woocommerce) in my spreadsheet problem

Hi everyone,
I’m new to Make (first week using it), and I could use some help.

Goal
I want to log every WooCommerce order into a Google Spreadsheet.

  • I start with the WooCommerce “Watch Orders” module

  • I end with Google Sheets, where I want to write the correct quantity of each purchased product into the right cell.

Problem
I sell around 15 different products.
When an order comes in, the line items always appear in different order and quantity in the WooCommerce module. So I can’t rely on position in the array.

I need to match Product ID → Quantity, and write that quantity to the correct spreadsheet cell.

I tried something like this:

{{map(22.array; "quantity"; "productid"; 2859)}}

But it doesn’t work. I also experimented with Iterator / Text aggregator / Array aggregator modules — I managed to structure the data, but I still can’t extract the correct values for each product ID.

Question
How do I correctly get the quantity for a specific product ID from the WooCommerce order array, and map it into my Google Sheet?

Any help or example scenarios would be amazing — thank you!

Hey there,

Can you show some screenshots of the scenario so far and what the incoming data looks like?

Just to be clear - you don’t want to log order products into rows in Google Sheets, e.g.:

order number, product, qty
order number, product, qty

but rather have a spreadsheet with a list of your products and track their sold quantity?

product 1, sold qty
product 2, sold qty

I’m not sure what your expected result is, to be honest.

In the second case- it would be pretty complex to achieve in both a scalable and operationally efficient way (credits usage), as you would need to have IDs of products from Google Sheets.

Personally- for the second case, I would transfer part of the logic into Google Sheets:

  1. Sheet 1 - bulk update with products and their QTY per order
  2. Sheet 2 - product sold qty calculated based on a formula (=SUMIF+saved qty*)

Example:
Sheet1:


Sheet2:

If you combine that with =UNIQUE() in A1 of Sheet1, you can create a fully scalable solution that won’t require any attention when new products are added.

*Tricky part - to optimize performance for long-term usage (does not matter if you have few orders daily), you’ll need to create a Make.com scenario that will save stats from Sheet 2 into saved qty mentioned ealier and clean up Sheet 1. But thats way easier and cost-friendly solution.

This is what i aimed for:

But what you are saying is: let make.com log in sheet 1 the order, and let google spreadsheet convert the log into a table in sheet 2. And remove the order in sheet 1 afterwards to keep a clean log?

Ok, now I understand what your goal is.
I still think two sheets would be much easier and more operationally efficient. You just need to work on Sheet2 and formulas to get the data you need. And think about data retention- with this approach you can even dynamically create new spreadsheet for each month. There are hundreds of possibilities in Make.

Partially. If you delete rows in Sheet1, Sheet2 won’t show you sales anymore.
So you must delete them when you don’t need these numbers anymore OR store the sums somewhere (and use this location with SUM.IF formula).

Also - I mentioned cleaning the log, but Google Sheets can handle even 5-10k records without slowing down on an average computer. So maybe it is not even worth worrying about :)?