Site icon BotFlo

10 How to confirm or update user input in Dialogflow ES

One of the questions people ask is the following:

After user provides some input, I would like to either confirm the input or allow them to update it

Let us use the slot filling chatbot as an example.

Once the user provides all the input, we were only displaying the list to the user.

Add the following output contexts to the book.flight intent

await_confirmation with a lifespan of 1

session-vars with a lifespan of 50

And also ask the user to confirm the inputs in the response.

If user says Yes, we will end the chat.

If the user says no, we ask them what should be changed

Suppose the user wants to change the return date. We will add an intent to do that. Note that the parameter you use in the table should be the same as the one you used in the slot filling intent. This will make sure that the original value inside the session-vars context gets overwritten by the new value that the user has input.

In the same way, we can also allow the user to change the departure date

You can add more such intents depending on your use case by following the same pattern

Let us test the bot using the Dialogflow Messenger integration.

Here is the use case where the user confirms immediately.

The user changes the return date

User changes the departure date

Exit mobile version