Zap integration between Kiavyo and Shopify - Nested line items is converted to string
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.
Page 1 / 1
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.
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,
@Kyle Hunt
Resources for handling arrays of line items in Zaps:
And, please check this screen. Clearly, a string is being sent to klaviyo, not array data.
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.
@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
Yeah, I already tried it but still I can get only the string of line items, not array. Please check the following screens.
The output I want is to send data in array format to Klaviyo.
@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.
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”,
]
}
@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.