Search code examples
dialogflow-cx

How do we ensure that the BOT remembers the name provided by the user?


DialogFlow CX

I am trying to ask the user her name, and then respond with "Nice to meet you " and then occasionally say that during the rest of the conversation. Not sure how to accomplish this in the bot. I understand we need to use @sys.person entity somehow, but not clear. Thanks.


Solution

  • You need to store in the variable like say person-name and if the name is detected by the Dialogflow then you can get the value in $session.params.person-name parameter which you can use for a single session.

    here session means let's take an example I have started a conversation with the Dialogflow bot and I have said like My name is Dhruv. So through out my session I can get the Dhruv(Detected name) for $session.params.person-name. So where ever I have returned like Nice to meet you $session.params.person-name then it'll be replaced by Dhruv in the conversation.

    Ref Video: https://www.loom.com/share/9da2fdbb9ac240df96955721b99c51af

    Let me know if you have any more doubts.