How to use Data Store

This tutorial will show you how to use the Data Store keys in your conversation flow.

Assumptions


Data Store is mostly used while replying back to the user i.e. you can use Data Store’ keys inside Message Node to reply the user.

All the Nodes in conversation flow, receives the data store by msg object passed to them.
At any node, you can get the data store in msg object like:
msg.govocal.dataStore.<Table Name>.<Key Name>

Example:
Suppose you have Data Store Table named as message and have following Key/Values belonging to this message table.


And you want to use the above shown WelcomeMessage key to send the response back to the user.
1. Open Flow designer
Open Flow designer and double-click Message Node to open its settings.

2. Add the table and its key name enclose inside {{...}} as shown below.

Structure

Above has 2 parts:
1.msg.govocal.dataStore part
Always use this part as it is.

2.message.WelcomeMessage part
This part represent the Data Store Table and its Key.
This part is made of <Table>.<Key>
So
2.a represents the Table Name, which here is message, and
2.b represents the Key Name, which here is WelcomeMessage