Skip to main content
Solved

Removing a property from an array

  • December 16, 2021
  • 1 reply
  • 255 views

Forum|alt.badge.img+2

Is it possible to remove a value from a custom property array? Or is it only possible to replace the existing value?

I’m worried about a race condition where a klaviyo flow adds an item to the array at the same time as my custom integration is resetting the value with /identify.

Best answer by David To

Hello @FeralTree,

Great question!

Although you can remove and unset profile properties using either the API or an Update Profile Property flow step method, this would remove/unset the entire profile property as a whole. You would not be able to remove/unset a specific value if the profile property was recorded in an array format. 

Depending on what your goal may be, I would suggest building in some delay as part of your identify calls or utilizing flow filters to alleviate these race conditions from occurring. If it helps, @Digimatic has a great thread on a similar subject of utilizing APIs to unset profile properties which I’ve included below:

I hope this helps!

David

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • Answer
  • December 16, 2021

Hello @FeralTree,

Great question!

Although you can remove and unset profile properties using either the API or an Update Profile Property flow step method, this would remove/unset the entire profile property as a whole. You would not be able to remove/unset a specific value if the profile property was recorded in an array format. 

Depending on what your goal may be, I would suggest building in some delay as part of your identify calls or utilizing flow filters to alleviate these race conditions from occurring. If it helps, @Digimatic has a great thread on a similar subject of utilizing APIs to unset profile properties which I’ve included below:

I hope this helps!

David