Search code examples
c#botframeworkazure-bot-service

Bot Framework Composer variable equivalent


When creating an Azure bot, the variable turn.activity.text I used in Bot Framework Composer is equivalent to turnContext.Activity.Text when coding in Visual Studio. I want to ask a question that what is equivalent to user.name or user.age in Bot Framework Composer when coding in Visual Studio?

Bot Framwork Composer image

Visual Studio Image


Solution

  • The bot needs to maintain user state to track the user's answers.

    Have you had a chance to check out sample /45.state-management/? It demonstrates how to save user and conversation data in a bot. The bot maintains conversation state to track and direct the conversation and ask the user questions.

    The above sample is available in other programming languages such as C#, JavaScript, Python, Java from the following link:

    https://github.com/microsoft/BotBuilder-Samples/tree/main/samples