Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending parameter value from one intent to anothet and assign it to parameter

I have two intents - serviceQuote and gotCar

In serviceQuote intent, user will input 3 parameters - carModel, carPrice and buyDate. And he will receive a quotation according to parameter values.

In gotCar user can say i just bought lamborghini.
Dialogflow will get carModel and fire up event of serviceQuote. I want to send this carModel value along with and assign it to serviceQuote parameter carModel without prompting to the user.

Please note that question to ask carModel is first in the serviceQuote intent design and all 3 parameters are marked as required.

I have tried to invoke the event and send parameter value along with it. Intent is triggered but parameter value is not being assigned and it is asking the user again for car model.

'followupEventInput' : {
    "parameters": {
        "carModel": "aston martin",
    },
    'name' : 'e_serviceQuote',
}

What am I missing? How to achieve it.
I am using DialogFlow v2.

Edit: I tried to enter #e_serviceQuote.carModel as value of parameter, but Dialogflow console is not allowing me to enter it.

car

like image 322
sid8491 Avatar asked Aug 08 '18 07:08

sid8491


2 Answers

You need to configure #e_serviceQuote.carModel in the Default Value for that parameter. That way, it'll be pre-filled with the value from that input context, or be empty if the context does not exist (or if the context exists but it doesn't contain that parameter).

Mouse hover on the parameter row

Then, set #e_serviceQuote.carModel as default value (in my example, it's #appointment.date)

enter image description here

like image 183
maganap Avatar answered Nov 22 '22 22:11

maganap


You just need to assign the value of the followupEvent carModel parameter to the intent's carModel parameter. This means, in your Action and parameters table of the serviceQuote intent, the value of the carModel parameter has to be #e_serviceQuote.carModel. Dialogflow intent

like image 35
Jesus Duran Avatar answered Nov 23 '22 00:11

Jesus Duran