botframeworkbot-framework-composer

How to reference a property in microsoft bot framework


I'm using Composer. The text prompt is - What is your name? And I want to store the user input in a $name property.

In the User Input section - under property - the placeholder gives examples saying you can use $birthday or dialog.${user.name}.

When I use $name as the property I am unable to then get access to the property during the reply eg the reply is "Welcome ......" - and the name is blank. I have tried Welcome {$name} and Welcome ${name} without success.

But when I use user.name in the property field then I am able to access the property and replying "Welcome Jack" works.

Could I please get clarification on whether $name or $birthday can be used to store values.

Thx

Thanks


Solution

  • Bot state handling is stateless, You have to specify the property with the state(memory) ex: user.Name, here the user is Bot user state(memory)

    once you specify the state, your property and value get stored otherwise it's lost.

    ex : user.name or user.birthday you get the values otherwise it's lost.

    bot has different memory states user state, Conversation state, dialog state, etc. For more information refer Bot state management