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
no item, this prevents us from utilizing the
is_defined condition when filtering the report.
Best answer by dladView original
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
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:
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.