How to steps all Woocommerce orders and add them to a Google sheet?

In my workflow I have the following configuration:

  1. steps.trigger +
  2. steps.woocommerce +
  3. steps.add_single_row_to_sheet

Step 1 works well.

Step 2 correctly fetches the data from the Woocommerce endpoint and creates the data structure.

Step 3 I have problems in the params section: I can’t create an interaction that works on all array data passed as a parameter. The intention would be to iterate each order present in Woocommerce and add it to a new row of a Google sheet.

I have no permissions problems with the Google sheet, that is correctly written if I use only one parameter intended as an order. But I care that all the orders in the array are iterated, and not just one.

The parameter I used is the following: {{steps.woocommerce.$return_value}}. I have tried others parameters but no result leads to writing all the orders on the Google sheet.

Best regards.

@indiagolf I’d recommend taking a look at this tutorial. Let me know if that helps!

Hi @dylburger.

Yes, it works. But it only works for default page (number 1) and doesn’t work for all order pages. Do you have any reference to iterate all the pages present in the end-point as in the following example?

  • From page 1: https://www.example.com/wp-json/wc/v3/products?page=1
  • To page n: https://www.example.com/wp-json/wc/v3/products?page=n

The information on the number of pages to iterate is contained in the header of the JSON response. So I think I need to access the X-WP-TotalPages key value.

Any information is welcome.

Best regards.