How to reset or remove a user property

Badge +1

Is there a method to reset a user property in Heap analytics? For instance, suppose we assigned the user property purchased_items a value of iphone for a particular user, but the order got cancelled. In such a case, we would like to remove the item from the property. We attempted to set null or an empty value, but it did not yield the desired result. Although we can set an arbitrary value like an empty array [] or no item, this prevents us from utilizing the is_defined condition when filtering the report.




Best answer by dlad 22 May 2023, 20:18

View original

2 replies

Userlevel 3
Badge +2

Hi James, great question, thank you for posting. Currently, you cannot “unset” a user property value. As you likely discovered, you can’t update the value with “null” as our API blocks the value as invalid. That said, I think it’s a good feature request and I’ve already submitted it to our Product team.

In the meantime, you can update the value with the number 0 or some other intentional string value that means “nothing” or “reset”, and add the analogous filters to your analysis. 

You could get “fancier” by using a Defined Property that wraps the underlying user property and has a condition for

“if <prop> is defined OR if <prop> !== 0” → “set value to <prop>”

ELSE null (no value entered)

and then use your new defined property in your analyses. That’s more cumbersome than being able to reset the property, but it should work! Example:


Badge +1

I appreciate your response and for submitting it as a feature request, @dlad. I am hopeful that it will be approved and implemented in the production environment soon. In the meantime, I will experiment with an arbitrary string and make use of the Defined property.