Msg91 Help Doc
Hello Contact Center
ChatBots in Hello
MSG91 Bot
Message Card
How to Store User Input in a Variable

How to Store User Input in a Variable

The chat bot can take user inputs and store them in variables as well. One can use these data and perform actions such as

  1. Record these user inputs in an excel sheet

  2. Update the data to a third party application such as CRM

  3. Perform data transfer through API and fetch real time data based on user interests

Follow below steps to store the user inputs in custom variables:

  1. Drag a message card to the canvas. Select the type as text.

  2. Type the message : “What is your name?”

  3. Check mark Input Expected from user

  4. MSG91 provides 3 pre-defined variables for one to use, customer_mobile, customer_name and customer_email.

    Screenshot 2025-06-09 5.42.47 PM.png
  5. Select customer_name and click on save.

    Screenshot 2025-06-09 5.44.20 PM.pngScreenshot 2025-06-09 5.44.28 PM.png

  1. In order to create a custom a variable, follow below steps:

  2. Enter the question in the text card, such as '“ Which country do you live in?”

  3. Check the Input Expected from User check mark.

  4. Type user_country in the store response tab

  5. Click on the “Create user_country” option pop-up.

  6. Click on save.

  7. Screenshot 2025-06-09 5.51.43 PM.png
    1. One can also read the user inputs saved in the variables or use them for the data transfer using APIs.

    2. Drag a message card, and type the message as : “Do you confirm you live in {{user_country}}? “. Click on Save.

    3. This will display/ read the user inputs provided by the user and will let you save it in a variable as well.