Best answer

How to format an order sent from shopify to asana.

  • 5 February 2021
  • 10 replies
  • 187 views

Userlevel 2

I created a zap to create a task in Asana from a paid Shopify order. The only problem is that it isn't formatted in a way that is easy for our manufacturer to read. So my question is how can I create cleaner and organized task using the data from Shopify orders. I looked up solutions and found text to line item in an article but that option doesn't show up in Zapier formatter. Any advice on this? 

Thanks

icon

Best answer by GetUWired 5 February 2021, 15:16

View original

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

10 replies

Userlevel 7
Badge +10

Hi @Mikemo77 

Can you show us some screenshot examples of where data isn’t looking like you want it to - and how you’d like it to look.

This makes it easier to suggest specific formatter steps you can use.

Userlevel 2

Thank you for the reply, this is how the order comes out in Asana. To correct my earlier post, I did add the text to line formatter but it didn’t format how I wanted. I would like each item to be listed with its quantity and size in its own section and not listed one after the other. I currently have the zap set up set up this way: Shopify paid order→ Filter ( item name contains team store) → Formatter → Create task in asana. 

This is how I had the formatter which I'm sure is set up wrong but any advice on making correctly would be awesome.

Thanks

Userlevel 7
Badge +12

I am not sure of a formatter that can easily accomplish it but it can be done through a code block.

Try something like this.
Action: Code by Zapier > Run Javascript

Set up the inputs like this

Then paste this into the code block
 

var task ="";
var i=0;

var qtys = inputData.qtys.split(",");
var lines = inputData.lines.split(",");
var sizes = inputData.sizes.split(",");

qtys.forEach(qty => {
task += `Shirt: ${lines[i]} \nQty: ${qty} \nSize: ${sizes[i]}\n\n`;
i++;
})

return {"Task": task}

The end result is a text field called “Task” that can be placed into your Asana task

 

 

Userlevel 2

Thank you for the reply, I appreciate it. I put the code in but got the following error message.

 

Userlevel 2

Disregard the last message! I accidentally put an “s” after qtys so it didn't read it correctly,  I think it should work now. Thank you!

I am not sure of a formatter that can easily accomplish it but it can be done through a code block.

Try something like this.
Action: Code by Zapier > Run Javascript

Set up the inputs like this

Then paste this into the code block
 

var task ="";
var i=0;

var qtys = inputData.qtys.split(",");
var lines = inputData.lines.split(",");
var sizes = inputData.sizes.split(",");

qtys.forEach(qty => {
task += `Shirt: ${lines[i]} \nQty: ${qty} \nSize: ${sizes[i]}\n\n`;
i++;
})

return {"Task": task}

The end result is a text field called “Task” that can be placed into your Asana task

 

 


I was hoping you could answer something in regards to this for me?
It works great, except for my options that are filled in with Infinite Options.
Those export into a list as pictured and each “size” is enclosed in brackets, quotes and comma separated [“(size)“] . This would be fine if each size didn’t sometimes have multiple items, within the brackets, that are separated by a comma. I tried using the closing bracket as well as the ],[  as the delimiter but that doesn’t work.
I would appreciate any help you can provide.
 

 

Userlevel 7
Badge +12

Hi @Amanda.75 

I would try setting up the option line as below. 

var options = inputData.options.split("], [");


or you could try just

var options = inputData.options.split("],");


Let me know if that works for you. The end result may stay have some brackets but those could also be removed. Let’s tackle on thing at a time for now though. 

 

Both result in this:

 

I had someone recommend using the unsplit and regex but I couldn’t figure out how to get it to work  with the options being ever changing with each order.
For now I’m just editing the entries, which is doable just annoying. haha

Userlevel 7
Badge +12

@Amanda.75 

Would you be able to just set var options = inputData.options 

 

and return that?

I am trying to recreate sample data that mimics how your data is coming in. 

or can you show me how the raw data is returned form Shopify?

Oddly, this is the result of setting options to that. it is taking the first item in the list and splitting it between the 3 item listings.

I’m guessing because the data coming in will vary for each item, that might end up being too big of a hassle.
This is how the order looks in my shopify, you can see the difference between the shopify variants (light grey font)) and the infiniteoptions variants (black font)