Skip to main content
Contributor I
December 16, 2021
Solved

Removing a property from an array

  • December 16, 2021
  • 1 reply
  • 296 views

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.

    This topic has been closed for replies.
    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

    1 reply

    David To
    Klaviyo Employee
    David ToAnswer
    Klaviyo Employee
    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