Closed JeevaTM closed 5 years ago
Hi this is not a Issue with dialogflow itself. You need to set promises to work with it. And the object db in this sample you just instantiate it twice var db = ... You can use the firebase dialogflow as example on how's you promises should look like at dialogflow fullfitment objects.
Hi this is not a Issue with dialogflow itself. You need to set promises to work with it. And the object db in this sample you just instantiate it twice var db = ... You can use the firebase dialogflow as example on how's you promises should look like at dialogflow fullfitment objects.
Thank you for the information.
Information I have gathered why it did not work and what changes has to be made in code:
function getData(name){
var PO_number;
return myCollectionModel.find({name : name}).exec()
.then( doc => {
return Promise.resolve(doc[0].PO);
});
}
function pending(agent){
var name = agent.parameters.person;
return getData(name)
.then( PO_number => {
agent.add(name + ", approval pending for following PO");
agent.add( PO_number );
})
.catch( error => {
agent.add("There no pending PO for approval, " + name + ".");
});
}
Can I use mysql to connect to dialogflow fulfillment?
I already did this buy i don't know how proof if it is connected or not
I wrote a basic function that connects to MongoDB using Mongoose, reads documents, and deployed the code in Cloud Functions. It responded correctly with the documents from MongoDB.
Code:
I wrote the code to accommodate in Dialogflow fulfillment in the following directions: When the intent is called, fetch the data, return it to the user.
Code:
It is not working. Does Dialogflow Fulfillment only support Firestore?