Xaviera Huisman
Xaviera Huisman

Reputation: 21

How come Dialogflow doesn't retrieve parameter value from fulfillment response?

At this moment I'm working on an advice conversation about holidays. We've created a feed in firestore with all the posible holidays including an url to the offer. The function we build searches for an offer in firestore and than provides the URL back to Dialogflow so it can be send to the customer.

In fulfillment I set the following response:

  "followupEventInput": {
    "languageCode": "nl",
    "name": "Query-Result"
  },
     "parameters": [
      {
      "url": "$urlvalue"
    }
   ]
}

in Stackdriver I see that there is indeed a url value in the provided response:

{
 insertId: "bdzlmdg1foc8wt"  
 labels: {…}  
 logName: "projects/vakantiesnl-dev/logs/dialogflow_agent"  
 receiveTimestamp: "2020-05-14T09:17:51.034607137Z"  
 resource: {…}  
 severity: "INFO"  
 textPayload: "Dialogflow fulfillment response : {"followupEventInput":{"languageCode":"nl","name":"Query-Result"},"parameters":[{"url":"https://www.vakanties.nl/griekenland/kreta/malia/real-palace?departure=28-08-2020&flexibleDeparture=False&hotelId=229003&offer=28-08-2020|8|RTM|HER|GT06-AO|STSD00000PSC|STSD00000P|VAKNLB2C|0"}]}
"  
 timestamp: "2020-05-14T09:17:51.019Z"  
 trace: "944e1df4-5f91-4766-94dd-6cd4c47edbf7"  
}

However, Dialogflow doesn't retrieve the parameter value into the conversation. In the intent I set the parameter as follows:

see screenshot of the parameters set in the intent of Dialogflow

In Stackdriver I see that the value for URL is indeed empty

      key: "url"
      value {
        string_value: ""
      }
    }

My question What do I need to to in order to retrieve the url value in the conversation?

Thank you so much in advance!

Upvotes: 1

Views: 193

Answers (1)

Prisoner
Prisoner

Reputation: 50701

It looks like you're setting parameters as part of an Intent that has an Event set. This isn't necessary, you can access the Event Parameters in your ressponse directly by using the #parameterName syntax.

In general, however, you can also just use your fulfillment to send back the response directly - you don't need to forward to an Event Intent just to send a response.

Upvotes: 0

Related Questions