In Dialogflow I have a Intent called GetLocation. The user can input a phrase like: I want to look at India, and the Parameter "Location", stores that location. For my Paramater, its name is "Location" and its entity is sys.location. Dialog Flow is able to recognize my location.
Next, Dialog Flow writes to my Firebase database and writes to the location parameter of the database (location: (location from DialogFlow). The problem is, instead of normally writing to the location parameter of the database, it also changes the "location" to admin-area: (location from DialogFlow). How do I stop it from renaming the location parameter in the firebase database?
Here is my Fulfillment code:
function yourFunctionHandler(agent) {
const location = agent.parameters.Location;
return admin.database().ref('locations').transaction((locations) => {
if(locations !== null) {
locations.place = location;
agent.add(`Our recorded locations ` + location);
}
return location;
}, function(error, isSuccess) {
});
// return admin.database().ref('/locations/place').set(location);
}