Question

Zap integration between Kiavyo and Shopify - Nested line items is converted to string

  • 22 February 2024
  • 11 replies
  • 40 views

Userlevel 1

Hi, there.

 

I created a zap workflow to send cart information (product id, title, price, quantity, preview image, etc.) to the Klaviyo event when a new abandoned cart is created in Shopify.
However, when line items array data obtained from shopify is sent to Klaviyo event, it is sent to Klaviyo in string format separated by \n.
Please resolve this issue urgently.

Thank you for your time and consideration.


11 replies

Userlevel 7
Badge +14

Hi @Kyle Hunt 

For us to have context, we would need to see how your Zap steps are outlined and configured along with a specific example of the data issue.

Userlevel 1

Ok, thank you for your reply.


First of all, the data I got from shopify is arranged in the following format.

Screen 1.

As you can see, the type of propertiesData is array.

 

However, when I try to select input data in a Klaviyo action, I can select individual fields of propertiesData.

Please check the screen 2.

So, as a result, what I want to do is send propertiesData to the klaviyo event in array format.

datas(screen 2) = propertiesData (Array)

I would appreciate your help in resolving this issue urgently.

Sincerely,

Userlevel 7
Badge +14

@Kyle Hunt 

Resources for handling arrays of line items in Zaps:

 

Userlevel 1


And, please check this screen. Clearly, a string is being sent to klaviyo, not array data.

Userlevel 1

Excuse me, I looked at the link you provided, but it didn't solve the problem I was facing.
Please check the screens I provided and provide step-by-step solutions so I can solve the problem myself.

Userlevel 7
Badge +14

@Kyle Hunt 

The data returned from Shopify is an array of line items.

The array is “propertiesData”.

The screenshot shows 1 line item.

The line item is an object that has 5 properties attributes:

  • ID
  • Title
  • Price
  • Quantity
  • Image

 

The link shows options for handling arrays.

The approach would depend on the specific format you want to send to Klaviyo.

Best to provide a specific example of the desired output.

 

One option is to use: Formatter > Utilities > Line Items to Text

 

 

Userlevel 1

Yeah, I already tried it but still I can get only the string of line items, not array.
Please check the following screens.

 

Userlevel 1

The output I want is to send data in array format to Klaviyo.

 

Userlevel 7
Badge +14

@Kyle Hunt 

In the Formatter step, you are mapping the entire Line Items.

You want to map the individual propertiesData variables.

e.g. [ID] | [TITLE]

That would result in: 7413758197860 | Mountain Path Sunset Color Multi-Names Premium Canvas

 

How the Formatter step should be configured depends on the structure of the data you are trying to send to Klaviyo, which we would need to see a specific example of the desired output.

 

Userlevel 1

So the data format I am trying to send to Klaviyo is as follows: 

{ propertiesData: [

id: 1343245,

title: “product title”,

price: 99.50,

quantity: 1,

image: “product preview image url”,

],

[

id: 1343245,

title: “product title”,

price: 99.50,

quantity: 1,

image: “product preview image url”,

]

}

 

Userlevel 7
Badge +14

@Kyle Hunt 

You would need to configure the Formatter > Utilities > Line Items to Step to reconstruct the desired JSON structure.

 

Otherwise, it involves an advanced approach to get the raw JSON from the Shopify Zap trigger step to be able to parse out the desired Properties JSON structure to send on to Klaviyo.

 

If you need help, consider hiring a Certified Zapier Expert: https://zapier.com/experts

Reply