Search code examples
node.jsgoogle-cloud-functionsdialogflow-esactions-on-googledialogflow-es-fulfillment

Get parameter value that didn't match original intent in a follow-up intent


Coding in NodeJS - Google Cloud Functions and actions-on-google library. All intents are fulfilled from the back-end.

I have an "Add to List" intent that matches to a "product" entity. When the user says something that does not match one of the entries in the entity list, it defaults to an "Add to List Fallback" fallback intent which asks the user "Do you want us to follow up with you about this unlisted product?", which has a fallback intent of "Add to List Fallback - Yes" for a "yes" answer.

My question - how in that final intent can I access what the user said in the first place? It never matched as the "product" parameter. I'm thinking it's something to do with the context, but not sure how to set that up in DialogFlow or access it in JS.

Thanks.


Solution

  • Since you are using fulfillment for everything, including that Fallback Intent, the easiest solution would be to store the value of what they said in the Fallback Intent in either a context or in the Assistant's session storage and access it from the Intent Handler for the "yes" Followup Intent.