Solved

Updating a custom list property via API is not working as expected

  • 14 May 2021
  • 1 reply
  • 57 views

Badge

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

icon

Best answer by Scott 17 May 2021, 15:36

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.

  1. 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.
  2. 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

View original

1 reply

Userlevel 1
Badge

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.

  1. 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.
  2. 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

Reply