Pass Custom Context Variables to the Bot

With variables you can optionally pass custom context variables to the bot when initiating a bot session. See What’s a Variable?. Let’s say you want the bot to greet the customer with their name. First, configure a CustomerName context variable in the Bot Builder.

Pass custom context variables to the bot

Then create a variables list and add the context variable with the value. Include this in the initial BotSendMessageRequest() object when you start the session.

You can then configure the greeting message to show the customer’s name. Here is the bot’s response message using the CustomerName context variable with the value “Jane Doe”.