Storage and conditions
Storage
Within an amp, you can obtain and store data about the users prior responses/selections. These can be used as conditions to feed the information back to the user, or define the users path based on their response/selection.
An example could be that you want to know the profession of a user, and if this user is a Doctor, you want to present some specific content to these users.
In the topbar, you will find the ‘Storage values’ popup makes with the :storage: icon. Open the popup and click the ‘Add new’ button in the bottom. Give the storage a name (it could be ‘Profession’, in the example above) and close the popup.
Now, add a question node, a button node or a question node to your canvas and define the values, you want to track, e.g. Doctor, GP, Surgeon or Nurse.
Apply the Storage by clicking the :storage: on the node and select the value in the dropdown.
Storage values can also be fetched directly inside a message node by clicking the :storage: icon in the message toolbar and selecting the storage. When the conversation is then triggered and the user has defined their profession as Doctor, you can the greet them in the next conversation with a message saying “Hello Doctor”
Conditions
Once the storage values have been defined, they can be used as conditions. A condition node has difference settings, and depending on if the condition is met or not (true or false), the user will be directed to the correct path for them.
Select the storage value in the first dropdown, define the condition in the second dropdown (contains, equals, not equals, has value, has not value) and define the key you want the condition to be true/false for. Add new nodes below each path to continue the conversation based on the conditions.