IDK
IDK

Reputation: 27

How to extract the specific values given by the user in the previous intent and use it in the next one in dialogflow?

How to extract specific values given by the user in the previous intent and use it in the next one?

Like - in the first intent the bot asks the user whats your name?

Then the user gives their name and the next intent is triggered.

The next intent the bot should respond to the users name with Hi IDK how may i help you?

Upvotes: 0

Views: 63

Answers (1)

Dhruv Rajkotia
Dhruv Rajkotia

Reputation: 380

For Dialogflow ES we can use the below approach to solve your problem.

Create an output context of the start/first intent to be triggered like DEFAULT WELCOME INTENT with the lifespan of the 500.

Use the #context-name.parameter in which you wanted to replace your parameters.

Let's take your example here.

Step 1: I have created an output context as a test with the 500 lifespan.

Step 2: Create a Name intent which captured the user name in the Name parameter

Step 3: I wanted to use the name in the confirmation intent, so In the confirmation intent I'll use #test.Name. So It'll replace with the captured name.

Ref: Dialogflow Es: Parameters

Just to update, with the Dialogflow CX you can directly use the session parameters to replace the captured parameters. ($session.params.parameter-id).

Let me know if you face any issue.

Upvotes: 1

Related Questions