How to split WooCommerce order items into separate Google Sheets

Status
Not open for further replies.

miguelq

Member
Hello,

I am trying to separate the different items from a WooCommerce orders into separate Google Sheets by Brand.

The logic I want to try is this:
  • If line item 0 name contains "Brand A", insert a new row in the Google Sheet A
  • If line item 0 name contains "Brand B", insert a new row in the Google Sheet B
  • If line item 1 name contains "Brand A", insert a new row in the Google Sheet A
  • If line item 1 name contains "Brand B", insert a new row in the Google Sheet B
  • and so on...
How I could do that? I was trying with routers, but if the order contained many line items, the resulting conditions would be a lot. I would like to do the split regardless of the number of items that contains the order.

Any ideas to do it simplier?

Best,
Miguel
 

ArshilAhmad

Well-known member
Staff member
Hi @miguelq,

Disable the Simple Response, click on the 'Re-Capture Webhook Response' button, and place a dummy order on WooCommerce. This will help you capture the data in an array format.

1694234461024.png


Then, you need to add an Iterator to your workflow as shown in the screenshot below. This Iterator will help you process each line item one by one.
1694234883995.png


At last, you will need to setup a Router with two routes.
 
Status
Not open for further replies.
Top