Question

Converting complicated string/list into line item

  • 3 October 2021
  • 1 reply
  • 109 views

Let me try to simplify my problem as best I can, and only give you the details that matter…

Here is a variable that gets brought into Zapier from my WooCommerce orders:

1. Line Items Meta Data Display Value
["Grey Steel/Black","Embroidery","24-35 pieces","Front of cap","Add additional embroidery location?","Side of cap","","This is a hat embroidered in two places, front and side",null], ["Coyote Brown","Custom patch","100 pieces","Front of cap","Add custom embroidery","Other","Top of hat please!","","Custom hat with patch on front, also embroider on top of hat",null]

This variable contains customization info about two different products: the info about the first product is contained in the first set of [ ] brackets, and info about the second product is contained in the second set of [ ] brackets.

What is the easiest way to convert this text into a set of line items, where all the details about the first product become the first line item, and all the details about the second product become the second line item?

For example, if the above could be transformed into something like:

1. Line Items Meta Data Display Value
"Grey Steel/Black | Embroidery | 24-35 pieces | Front of cap | Add additional embroidery location? | Side of cap | This is a hat embroidered in two places, front and side”, "Coyote Brown | Custom patch | 100 pieces | Front of cap | Add custom embroidery | Other | Top of hat please! | Custom hat with patch on front, also embroider on top of hat”

That would be ideal! Any help is appreciated, thanks


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

1 reply

Userlevel 7
Badge +14

Hi @IdleWilde Printing 

Check out this help article about using Line Items in Zaps: https://zapier.com/help/create/basics/use-line-items-in-zaps