Storing data

There are two ways to store data from a user, either by getting them to press buttons, or by getting them to enter free text.
The data is stored against the user in the database. You can then retrieve the data to either be used by the bot (explained later in this article), or simply by downloading a CSV of the saved responses.

Store button presses

When creating a button or a quick reply, you can set the button type to be “Save this information with a user attribute”. Select a user attribute to save the response against the user so that you can retrieve it later, perhaps you want to use the label ‘feeling’. Then finally select the message you want to send the user once the response has been saved.

Store free text answers

Although buttons are useful to save most attributes, sometimes you want to ask the user an open ended question. But you still want to store the response against the user. These are done slightly differently from buttons, instead you need to choose a Q&A message part.

Add a Q&A message part, and then hit the cog to access to the settings, set the user attribute save against the user, perhaps you want to use the attribute ‘address’.

Now when a user responds to that message, it will save their response against their user profile in the system as a ' user attribute'.

*If you’ve created a user attribute, use $ + your attribute name to recall the user’s response. E.g. if your attribute name is ‘food’, {{$food}}.


Retrieving data

Once you’ve managed to store data against a bot user you can then retrieve it to use it in another message sent to a bot user.

Let’s say you used the attribute "RESPONSE" when storing data. You can now use that data in another message by simply using the shortcode “{{$RESPONSE}}”.

Just how you would use “{{first_name}}” to refer to the user's first name.

If you want to export it all, you can export all the saved data as a CSV.

Please let us know if you feel the article helped you. Just click one of the emojis below. Thank you

Did this answer your question?