You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
Good afternoon I need help because the designed program shown below manages to transfer the information to the consolelog but it is not able to send it to dialogflow through agent.add function. In mongo db database is the information of people with name, department, position and mail. From dialogflow it will receive the position and the department, and the program must be able to search in the mongodb database a person who fullfils those two requirements and send all the information back to dialogflow. I think the key is to use the find() function and then know how to take that information to an array, but I don't know how. Any help is appreciated. (All functions for connecting to moongose are assumed to be OK.)
`function ConsultarDepartament(agent) {
var departament = agent.parameters.departamentos;
var cargo = agent.parameters.cargodepartamento;
contactodepartamento.find({departament : 'departament', cargo : 'cargo'})
.exec((err, res)=>{
if(err) return console.log('Error ' + err)
else console.log(res);
});
agent.add('The name and email of the person you are looking for is: '+);
}`
The text was updated successfully, but these errors were encountered:
++ The result coming from the function is an array stored in "res" as coming from mongodb:
{ _id 6*** department : "Automatic". cargo : "Director" name: "D*** mail: "d***" }
The problem is that I don't know how to get from the variable "res" that comes from mongodb, the name and the mail and put it in agent.add to send it to Dialogflow.
A value that is stored in an array (res[0].name) coming from the mongodb database, has to be sent to dialogflow by using agent.add. It turns out that in the visual studio console the value res[0].name appears correctly, but when you add it in agent.add('The name is: '+res[0].name) the result in dialogflow is NOT AVAILABLE. Does anyone know if you need some kind of converter?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Good afternoon I need help because the designed program shown below manages to transfer the information to the consolelog but it is not able to send it to dialogflow through agent.add function. In mongo db database is the information of people with name, department, position and mail. From dialogflow it will receive the position and the department, and the program must be able to search in the mongodb database a person who fullfils those two requirements and send all the information back to dialogflow. I think the key is to use the find() function and then know how to take that information to an array, but I don't know how. Any help is appreciated. (All functions for connecting to moongose are assumed to be OK.)
`function ConsultarDepartament(agent) {
The text was updated successfully, but these errors were encountered: