Question

Data In - Line Items to Data Out - Columns

  • 26 October 2019
  • 4 replies
  • 1006 views

Userlevel 3

Hi - I've got 3 line items (Item, Qty, Price) from WooCommerce via the WooCommerce-Zapier extension.

I'm trying to output these in columns with a header (Item, Qty, Price), but I can't see how to do it.

The line items come in as 3 separate comma delimited lists

Any clues or pointers anyone?

Many thanks

Seamus



This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 3

At the moment when I try it outputting to Google sheets I can get it to work, but what I need is a way to output that into an email.

Or output the line items directly into an email

Seamus


Userlevel 7
Badge +10

@Seamus can you use a temporary google sheet as an intermediate step...


Step 1: Trigger (use the one you've been using)

Step 2: Create a new worksheet in your temporary google doc, with 4 columns, your three and a 4th one called "one"

Step 3: Use "Create Spreadsheet Row(s)" to put the values in there (in the 4th column called "one" just put a 1)

Step 4: Do a Google Sheets find many rows (either: "Find Many Spreadsheet Rows (With Line Item Support)" or "Get Many Spreadsheet Rows (Advanced, With Line Item Support)") which will give you 10 or 20 rows, not sure how many rows you'll have. Use the "condition" where the value in column one is 1.

Step 5: Email, use the output of step 4 in an email (it's line-items, but connected as a row instead of single values).

That might work in your situation.



Userlevel 3

Thanks Paul, but that only gave me comma delimited lists in the email.

I've been trying to add a for loop in python but I keep getting this error "Your code had an error!" Which doesn't help me much at all!

I'm thinking if I could output the data as the 3 separate lists using python, then I could html code columns in the email and put each list in each column - but I can't get my python to work

The code I'm using this data is

code.jpg

for i in input_data[MyItems]:

print(i)

Any ideas ?

Many thanks

Seamus


Userlevel 7
Badge +9

@Seamus and @PaulKortman just circling back on this one! Paul, did you see Seamus' last response and do you have any other suggestions? Let us know!