I would like to reset some user attributes on the bot as the customer will be ordering food. it is likely that the user will order something different each times. How should I go about resetting some attributes while keeping others such as their address?
All attributes can be replaced if you store a different value using the same attribute name. For example, if the customer has attribute “food” with value “salad”, you can store an attribute again with the name “food” (in the same topic or different topic) to change “salad” to “pizza”. All the attribute names (system attribute or custom attribute) are customizable, you can change them to best describe your business needs.
If I understand right, some attributes you do not want to replace by not asking the question multiple times (e.g., only asking “where do you live?” once for the same customer). Correct me if I am wrong. This can be done by set precondition of the topic to be depending on the attribute. This is something we are currently working on, it will be available soon.
However, we have not exposed explicitly removing an existing attribute’s value on our Design page. If that is what you want, would you mind explain how you would like it to be used?
I think that a way to assign default values to custom attributes and a way to make them revert to default on a new session or when certain actions are triggered in a flow would be a good starting point!
Thanks for the feedback. We will prioritize this. Updates to the attribute will come soon. Stay tuned!
While we are working on updating the attributes, in case you want to reset some of your attributes upon restarting the chat, you can work around by adding the following to the welcome message
`(store-user-attribute "food" "")`
This will reset the “food” attribute to be empty upon starting.
If you want to have a default value for “food”, for example “soup of the day”, you can replace the empty quotation marks with “soup of the day”. So your welcome message will be something like this:
Hello,...`(store-user-attribute "food" "soup of the day")`
You can set multiple attributes in the welcome message as well.
Hello,...`(store-user-attribute "food" "soup of the day")` `(store-user-attribute "#people" 3)`