Updating a custom list property via API is not working as expected
Hello,
I want to update the Shopify Tag propery
which on edit mode looks like this:
Updating it via UI works, but when I do it via API the quotes are escaped
To reproduce it you can simply do a PUT cURL request like described in API docs
Please let me know if I’m doing something wrong, the docs are wrong or if you need any additional info.
Thanks
Page 1 / 1
Hi @Petru
In order to update or add an array/list property to a profile you need to pass the query parameter and value for each item in the list e.g.
?newKey=cat&newKey=dog
This will then be reflected on the profile as
Two things to note.
Updating a custom property will overwrite the existing one. If you are adding an item to the list/array you’ll need to include all the existing values in your PUT request.
If you only add a single value this will convert the value to a string and it will not longer be a list.
Additionally, it’s not recommended to manually update the Shopify Tags property on a profile as this property is automatically updated through the Shopify integration sync. This property does not sync back to Shopify, therefore the value can get out of sync if it’s updated manually in Klaviyo.
Best,
Scott
Thanks for this answer @Scott - helped me out today :0)
However, I have a load of profiles that include an ampersand in the value of a list-type property, like this:
Of course, the ampersand breaks the query string in the request url. Is there a way of including an ampersand in the value of the list property when updating via the api?