Search code examples
javascriptnode.jsdialogflow-esdialogflow-es-fulfillmentdialogflow-cx

Is it possible to enable the 'required' option for Dialogflow Intent Parameters using Node.js?


I'm trying to create an intent with a 'required' parameter that will prompt a response once the parameter is not satisfied. Is this possible through Node.js? If yes, how could I execute this. Thank you!


Solution

  • You can set parameters as "required" using the Node.js client library:

    For Dialogflow ES, when creating an Intent using the createIntent method, set the request.intent.parameters.mandatory field to “true” for the parameter you want to be required.

    For Dialogflow CX, when creating a Page using the createPage method, set the request.page.form.parameters.required to “true” for the parameter you want to be required.