Dialogflow Tutorials: Integrate Dialogflow Chatbot with Database

  Рет қаралды 60,615

AxleWeb Technologies

AxleWeb Technologies

Күн бұрын

Пікірлер: 303
@arjunkv8919
@arjunkv8919 5 жыл бұрын
How we can read multiple child from database
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Suppose there are multiple child, in that case, the data structure will change slightly. It will be something like this: data |_ 1 |_ first_name: Rahul |_ last_name: Sharma |_2 |_first_name: XYZ |_last_name: ABC You need something unique like ID (Here I used 1, 2 etc but you can use username, email or anything which is unique) to uniquely identify a record. Then the code to write into the database should be something like: return admin.database().ref("data").child(ID).set({ first_name: res.data.first_name, last_name: res.data.last_name }); Where ID can be 1, 2, 3.. and so on.... And code to read from database should be something like: return admin.database().ref("data").once("value").then((snapshot) => { const value = snapshot.child(ID).val(); const first_name = value.first_name; }
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
You can also refer to below documentation: firebase.google.com/docs/database/admin/save-data
@aswinsdeep3524
@aswinsdeep3524 5 жыл бұрын
@@AxleWebTechnologiesthanks buddy
@sivakarthick2924
@sivakarthick2924 5 жыл бұрын
@@AxleWebTechnologies Thanks man! I was stuck in this part for a while. Your video helped me a lot. Can you please post a video on how to access Firebase cloud functions using fulfilment. I have a JSON file in the Cloud function but I'm not able to access it in Dialogflow. Please help me with this.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
@@sivakarthick2924 Glad you find it useful. Will create a video on accessing Firebase cloud functions soon. Please subscribe and press the bell icon to get the updates.
@harshshah2675
@harshshah2675 4 жыл бұрын
Thank you very much Sir for posting this, but when I click on enable inline editor in fulfillments it asks to manage billing and a billing account. whereas in this video you weren't asked to enable billing? Have you already enabled billing and does it charge when we connect it to firebase?
@jpesmar
@jpesmar 5 жыл бұрын
You deserve way way more subscribers. I've already told all my coworkers about your videos. Amazing stuff you have here. Thanks!
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Thank you so much for such a wonderful comment. Will try to keep adding more videos on chatbots frequently.
@rodcastillo2578
@rodcastillo2578 2 жыл бұрын
Thank you!! I wish your next video is bigquery to dialogflow
@abdelrahmanmustafa2955
@abdelrahmanmustafa2955 2 жыл бұрын
thank you so much for your tutorial, is it available to link DF CX with firebase to read and write like exactly DF ES
@pogrammerinthehouse8643
@pogrammerinthehouse8643 4 жыл бұрын
just came across this video,had subscribed already
@stefanostanich2245
@stefanostanich2245 4 жыл бұрын
Thank you for video, it works fine. I need to read from firebase not only text, but other fileds to display Rich Response such as Basic Cards, Suggestion chips and simple response (Google Assistant integration). Do you have some codes or suggestions? Thank you so much!
@what_to_watch_today
@what_to_watch_today 4 жыл бұрын
Hello, thanks for the video, why do you choose realtime database instead of cloud firestore ???
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
There is no specific reason. Both are great. In some projects we have used cloud firestore as well. The choice depends on your use case. Please refer to this link for more details: firebase.google.com/docs/database/rtdb-vs-firestore
@hemantsahu4757
@hemantsahu4757 2 жыл бұрын
Could you please tell me whether I can store the conversation done from chatbot by every user in the database to have a track on what all queries is being asked from the users. Please let me know!
@everybot-it
@everybot-it 4 жыл бұрын
This doesn't seem to work in some cases. Particularly, when some credentials have been set and the ApplicationDefault isn't working.
@harshshah2675
@harshshah2675 4 жыл бұрын
Hello Anshul Sir, Can I connect chatbot to firebase database without enabling billing? If yes then can you tell how to do it
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes, you can do that by using Custom Webhook option (Fulfillment > Webhook) However, you need to keep in mind that you have to setup your own web server which can accept POST requests in order to get this working.
@FelipeMarquardt
@FelipeMarquardt 5 жыл бұрын
Thank you very much for this tutorial! I´d like to ask: is it possible to save the sessionId on Firebase?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
yes definitely, sessionId depends on which platform you are using for e.g. facebook, slack etc. Check the response format for corresponding platform and then save it in firebase database.
@hhbounce
@hhbounce 5 жыл бұрын
@@AxleWebTechnologies is it possible to have an example?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please email me at anshul.shrivastava@axlewebtech.com. will send you over email
@letsgoo5176
@letsgoo5176 4 жыл бұрын
excellent ... may i know can we develop multi language understandable bots though dialog flow ? English/Arabic
@AxleWebTechnologies
@AxleWebTechnologies 3 жыл бұрын
please drop an email to anshul.shrivastava@axlewebtech.com, we can discuss your requirements.
@vikaskanchan6516
@vikaskanchan6516 7 ай бұрын
Can we connect Dialogflow to another database like Mongo DB etc..?
@BenRunciman
@BenRunciman 5 жыл бұрын
Hi, Thank you for this video tutorial! I'm just wanting to connect my Dialogflow Bot to a database of information about films. I want the user to be able to ask. Is Ant-man covered by my film license? and for the bot to respond Yes or No. I have a csv file with the data. What do you think would be the best way to do this?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please contact me on Fiverr. fiverr.com/anshul0305
@alanreyes6637
@alanreyes6637 5 жыл бұрын
Muchas gracias, estuve buscando esto por la red durante varios días y no entendía nada hasta que acabo de ver tu vídeo. Ya me suscribo a tu canal y de nuevo gracias!
@joseossesplaza4007
@joseossesplaza4007 4 жыл бұрын
i follow of the steps and i dont read my firebase :c, maybe exist other method for fix my mistake ?
@waelbnd3536
@waelbnd3536 3 жыл бұрын
thank u for all ur videoes, but u alway use the Inline Editor in fulfilment and it's not free, plz try other free solutions and thaks again
@AxleWebTechnologies
@AxleWebTechnologies 3 жыл бұрын
Please watch our latest videos on Dialogflow and Integromat, That solution is completely free and does not require inline editor.
@waelbnd3536
@waelbnd3536 3 жыл бұрын
@@AxleWebTechnologies thanks
@zahidkhan-ln3jv
@zahidkhan-ln3jv 4 жыл бұрын
What if I want to store multiple orders of a restaurant?how can I do that as this only gives the most recent value
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please have a look at the pinned comment.
@saikirandas5461
@saikirandas5461 4 жыл бұрын
Is it possible to store documents.. Then How to store the documents in data base
@tinashegondwa
@tinashegondwa 4 жыл бұрын
Hi Axle, thanks for the tutorial, really helpful and educational. Is there a way to connect a Dialogflow Agent to an Oracle Database. If so may you please share how it can be done. Thanks
@AnshulShrivastavaOnline
@AnshulShrivastavaOnline 4 жыл бұрын
At the moment I am not sure about Oracle database, but will try to explore this and create a video
@tinashegondwa
@tinashegondwa 4 жыл бұрын
@@AnshulShrivastavaOnline Thanks so much. In anticipation
@tirtharaja
@tirtharaja 4 жыл бұрын
Very good explanation for beginners.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Glad you liked it
@nihalbuyukotcu6591
@nihalbuyukotcu6591 3 жыл бұрын
Thanks for sharing ! If I want to do this can i try it for free ? Can i open my dialogflow project in firebase with no pay ?
@AxleWebTechnologies
@AxleWebTechnologies 3 жыл бұрын
Yes, you can
@jayhu6075
@jayhu6075 4 жыл бұрын
What a great explanation. Hopely more in 2020? Many thanks.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes definitely. Please subscribe to stay updated with latest videos.
@hapuertam91
@hapuertam91 4 жыл бұрын
Thanks for sharing, can u help me on how to add more records in DB instead of replace the only one existing? thanks in advance
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please have a look at the pinned comment. Hopefully, that will help.
@mayankparikh4335
@mayankparikh4335 5 жыл бұрын
Hi ..it's comming snapshot and value not defined..in the fullfilment can u help me out regarding this
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Probably something wrong with the format in which you are storing your data in firebase. Have a look here: stackoverflow.com/questions/43196547/firebase-unable-to-access-data-with-snapshot
@raddyjtc1440
@raddyjtc1440 5 жыл бұрын
Thanks! It worked well. However, this will not work if i deploy using node.
@hamademic
@hamademic 5 жыл бұрын
@Axle Web Technologies Please Help
@muhamedkozic9440
@muhamedkozic9440 Жыл бұрын
I follow all steps, but in the end it is not working. When i write something to save to DB, the text parametar is not chaning in the firebase DB. It stay "ABCD". Do you have any solutions?
@harshshah2675
@harshshah2675 4 жыл бұрын
Hello Anshul sir thanks a lot for your response I tried deploying a cloud function through inline editor but getting this error: Permission 'cloudfunctions.functions.setIamPolicy' denied on resource 'my-cloud-function-path' (or resource may not exist). Can you please assist or let me know what level of permission did u have while deploying this
@rosanasr
@rosanasr 5 жыл бұрын
Hey!! Tks so much for this video! I managed to go to the point of writing the first parameter in the database. But when I set the second one, the first one is erased from the database. (the first parameter turns red in firebase and the last one turns green) This is the code: function handleCompanyName(agent){ const text = agent.parameters.companyname; return admin.database().ref('data').set({ companyname: text }); } function handleAccountingType(agent){ const text = agent.parameters.accountingtype; return admin.database().ref('data').set({ accountingtype: text }); } let intentMap = new Map(); intentMap.set('welcome', welcome); intentMap.set('Default Fallback Intent', fallback); intentMap.set('company.name', handleCompanyName); intentMap.set('accounting.type', handleAccountingType); agent.handleRequest(intentMap); }); I'll have to do this for around 30 parameters, so I'm kind of lost on how to follow as is not working from the second one. The second question is that for some other intents I have up to 5 different parameters. For example, I have an Onboarding preferences intent, and I ask for datastart (using @sys.date) and financialswhen (using one entity I created called @financials-when). As they are all under one Intent I couldn't understand how to write this code. Thanks in advance for your help!
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Hello Rosana, Please see my pinned comment. You need to use ref("data").child(ID).set() Where ID is a unique ID of each entry in the database. Feel free to comment back if you still have any questions.
@rosanasr
@rosanasr 5 жыл бұрын
@@AxleWebTechnologies yes, is working. Now the code is like: function saveCompanyName(agent){ const companyname = agent.parameters.companyname; return admin.database().ref('data').child('company name').set({ companyname: companyname }); } And the database is like: data accounting type accountingtype: "Quarterly" company name companyname: "Apple" :) I'm not sure if for the ID is better to use a number or a name as I'm doing now. But I can change later on if necessary. Now I'll try the multiple entries from one intent and let you know if successful or if I have more questions. Thanks a lot!
@rosanasr
@rosanasr 5 жыл бұрын
@@AxleWebTechnologies Also done with more than one parameter from a unique Intent. Code that worked: function saveStartandOnboardingDate(agent){ const datastart = agent.parameters.datastart; const financialswhen = agent.parameters.financialswhen; return admin.database().ref('data').child('start and onboarding').set({ datastart: datastart, financialswhen: financialswhen }); } Thaaaanks!
@TechiesLab
@TechiesLab 4 жыл бұрын
Thanks for the vidoe and could you tell me how to connect dialogflow with aws redshift database
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
we haven't explored that yet, we will try to explore that and then will create a video tutorial on that.
@devpratap
@devpratap 5 жыл бұрын
Hello sir ,your tutorials are great. Thanks for uploading them I wanted to know how to make a Chatbot which can place order on your behalf. E.g. Amazon . The bot should be able to search products, set quantity and direct you to payment directly.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
please contact me on Fiverr fiverr.com/anshul0305
@ashishagru
@ashishagru 5 жыл бұрын
Hi AxleWeb. Thank you very much for this excellent video. I followed your instructions. The SaveFromDB works very well, but the ReadFromDB gives the string The value from database is ${value} instead of converting text value in value. I have put them in backtick key. Also, I noticed that when my savetoDB command works, it stores information as "Hello World INSTEAD of "Hello World" in your example. Attached is my code. Can you help? 'use strict'; const functions = require('firebase-functions'); const admin = require('firebase-admin'); const {WebhookClient} = require('dialogflow-fulfillment'); const {Card, Suggestion} = require('dialogflow-fulfillment'); admin.initializeApp ({ credential: admin.credential.applicationDefault(), databaseURL: 'ws://dfdatabasedemo-xhpqqm.firebaseio.com/' }) ; process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { const agent = new WebhookClient({ request, response }); console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); function welcome(agent) { agent.add(`Welcome to my agent!`); } function fallback(agent) { agent.add(`I didn't understand`); agent.add(`I'm sorry, can you try again?`); } function handleSaveToDB (agent) { const text = agent.parameters.text; return admin.database().ref('data').set({ first_name: 'Rahul', last_name: 'Sharma', text: text }); } function handleReadFromDB (agent) { return admin.database().ref('data').once('value').then((snapshot) => { const value = snapshot.child ('text').val(); if (value !== null) { agent.add('The value from database is ${value}'); } }); } let intentMap = new Map(); intentMap.set('Default Welcome Intent', welcome); intentMap.set('Default Fallback Intent', fallback); intentMap.set('SaveToDB', handleSaveToDB); intentMap.set('ReadFromDB', handleReadFromDB); agent.handleRequest(intentMap); });
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Hi Ashish, you need to use backtick in the below code agent.add('The value from database is ${value}'); so it should be something like this: agent.add(`The value from database is ${value}`);
@holdinvestors6935
@holdinvestors6935 4 жыл бұрын
hi, buddy, may I ask you a favor? I followed the vedio , Writing data feature is OK, but READ DATA feature has been wroten many time. hope you can introduce more knowledge about it.
@sheebarizvi2330
@sheebarizvi2330 5 жыл бұрын
Awesome!! This is so good😍😍😍🙏🙏🙏 So much in depth knowledge...Wow great!!!
@NithishKumar-uo7oz
@NithishKumar-uo7oz 4 жыл бұрын
how can we retrieve data from database (that was updated by agent data) into react native app
@deepakjain5169
@deepakjain5169 5 жыл бұрын
Very helpful video. Actually, I'm looking to create a database layer where I save all the keywords, conversation, etc that's happening in dialogflow in the database and use it further
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
That's great. Are you facing any issues?
@dialogstack754
@dialogstack754 5 жыл бұрын
@@AxleWebTechnologies Can you explain me how should I do that ?
@atineshs
@atineshs 5 жыл бұрын
Thanks for the efforts, I wanted to know if we can connect Dialoglow with PostgreSQL database
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Yes we can connect Dialogflow with PostgreSQL, MySQL, MariaDB etc. I will create a video on this topic soon. Please subscribe and press the bell icon to get the latest updates.
@chinmaymunje9279
@chinmaymunje9279 5 жыл бұрын
How we can build a Chatbot like Google home for only one category and fetch Realtime data from database. Also please make video on how to deploy this Chatbot in android studio.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
You can use Dialogflow for building Google home chatbot. They call it actions on Google. Visit developers.google.com/actions/ for more details. Android studio is for building apps for Android OS. I would recommend using Visual Studio Code for chatbot coding.
@ashishajmani
@ashishajmani 5 жыл бұрын
Thanks. great tutorial....I have written same code...but while ReadfromDB intent, it is not picking variable from db...instead is shows simple message -> The value from database is ${value} ......my code is as below: function handleReadfromDB(agent){ return admin.database().ref('data').once('value').then((snapshot) => { const value = snapshot.child('text').val(); if(value !== null) { agent.add('The value from database is ${value}') ; } }); } any guesses where I am doing wrong ?
@PenquinQQ
@PenquinQQ 5 жыл бұрын
I got the same result as you.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Hi Ashish, you need to use backtick in the below code agent.add('The value from database is ${value}'); i.e. use ` instead of ' so it should be something like this: agent.add(`The value from database is ${value}`);
@renielmallari3236
@renielmallari3236 4 жыл бұрын
hi sir. how can i save the whole conversation of each user in the firebase?
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
For that you need to use Dialogflow Webhooks and APIs.
@rohannayak5971
@rohannayak5971 4 жыл бұрын
I wanted to create a cart and store products. So how can I add multiple data in a same child.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please check the pinned comment
@jonaszprzybycien6545
@jonaszprzybycien6545 4 жыл бұрын
5:12 I'm a little confused. Are the training phases the same regardless of how the database is used? Asking because we have an project at our college about creating a voicebot for a restaurant. We want it to work so that people can order pizzas without calling real people.
@AnshulShrivastavaOnline
@AnshulShrivastavaOnline 4 жыл бұрын
The training phrases are used to trigger an intent. Please contact me at anshul.shrivastava@axlewebtech.com if you any specific help.
@frankramirez4214
@frankramirez4214 3 жыл бұрын
Hello I hope you can help me ... I have the code as you wrote it and it worked very well but a few weeks ago I stopped writing my dialogflow in my firebasedb ... I did not change anything in the code or anything in the chatbot ... why will it be that no longer saves the data? first of all, Thanks
@AxleWebTechnologies
@AxleWebTechnologies 3 жыл бұрын
Have a look at Firebase database rules. Generally firebase rules are configured for allowing read write for 1 month from the initial setup date.
@venkatabhilash4325
@venkatabhilash4325 4 жыл бұрын
I am retrieving json data according to my need from firebase. I am now facing problem on how to represent this array of data in the agent response. Can you suggest me any reading material or help with the code. Thanks in advance
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please try checking firebase documentation.
@walney2008
@walney2008 4 жыл бұрын
ola como faço para insert,delete and search ? existe use banco MySQL ? exemple, tnhks
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please watch these videos: kzbin.info/www/bejne/rGjOZqmZoLithNE kzbin.info/www/bejne/omGUh5R5rpiooK8
@nunongsantiago7795
@nunongsantiago7795 4 жыл бұрын
I had I few errors. Could you please share the code?
@shirishsonawane3807
@shirishsonawane3807 4 жыл бұрын
Thank you so much for your help and guidance. Please help me with the below queries . Appreciate any pointers from you :) queries ====== 1. can we give reference (vegetables in this case ) as input which is taken from user? (or does it need to be hardcoded ?) 2. how do i get value of parameter which is child of a child [in this case : input is patato -- i want to get soil_ph_value of patato ] 3. can we store image as a parameter here (patato pic for e.g)? structure in database : ================== vegetables patato growing_time soil_ph_value tamato growing_time soil_ph_value ================ Pseudocode : (not working) =================== const veg_input = agent.parameters.veg_input; agent.add(` veg input is :${veg_input}`); return admin.database().ref('vegetables').once('value').then((snapshot) => { const time_to_grow = snapshot.child('veg_input').child('grow_time').val(); agent.add(`your growingtime is :${time_to_grow}`); ===================== Please guide .. thanks
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Try this: const veg_from_db = snapshot.child(veg_input).val(); const time_to_grow = veg_from_db.growing_time
@shirishsonawane3807
@shirishsonawane3807 4 жыл бұрын
@@AxleWebTechnologies Thanks a lot for your help and guidance. It did work for me . :)
@aswinsdeep3524
@aswinsdeep3524 5 жыл бұрын
how we can store information of many number of people in firebase database? is there an option that, we can create automatically generating tree in firebase?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Hello, see my reply for following comment: "How we can read multiple child from database"
@saikirandas5461
@saikirandas5461 4 жыл бұрын
And then how to store the database in cloud
@jaceytan7116
@jaceytan7116 4 жыл бұрын
How can i implement this feature to my Android studio mobile app project ?
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
For that you need to use Dialogflow API. We will launch video tutorials on Dialogflow APIs soon. Please subscribe to our channel and press the bell icon to get the latest notifications.
@venus3119
@venus3119 2 жыл бұрын
is it the same way with Mongodb? thanks!!
@AxleWebTechnologies
@AxleWebTechnologies 2 жыл бұрын
No,for mongodb we need to create an api.
@MikeCairns1
@MikeCairns1 4 жыл бұрын
Did you publish your code for the fulfillment somewhere? I can't get my code to work and I know that there is a simple syntax that I missed. I got the write to work fine, but I can't get reading to work properly.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes here it is: Connect Dialogflow with MySQL gist.github.com/Anshul0305/aace32e8eabcb2ef49835d0079091e00 Connect Dialogflow with Spreadsheets gist.github.com/Anshul0305/0af703a063f51ca00213add2634cd88b Connect Dialogflow with External APIs gist.github.com/Anshul0305/405e050cf438975baec8a746ffda9991
@rushj5227
@rushj5227 5 жыл бұрын
Thanks for a great tutorial, I want to build an bot which asks users their Id and some 10-20 questions and then it should be saved in fire base with their mail -ids and answers can you please help? @Axle Web Technologies
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Yes, I can definitely help you with that. Please mail me the details on anshul.shrivastava@axlewebtech.com or visit us at axlewebtech.com
@ratulpahwa7220
@ratulpahwa7220 4 жыл бұрын
Will the data stay in the database once the session ends
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
yes absolutely
@mani5004
@mani5004 5 жыл бұрын
can you please make a video on google home graph. ?
@renielmallari3236
@renielmallari3236 4 жыл бұрын
Hi sir why am i getting a Webhook call failed. Error: DEADLINE_EXCEEDED. in reading the data from the firebase? i can already save the data but when i am trying to retrieve it there is that error. i followed you code and the error is still the same. can you help me sir function HandleReadFromDB(agent){ return admin.database().ref('data').once('value').then((snapshot)=>{ const value = snapshot.child('text').val(); if(value !== null){ agent.add(`The value from the database is ${value}`); } });
@vishalgulati6383
@vishalgulati6383 5 жыл бұрын
Really nice. Thanks!
@cautioncold1640
@cautioncold1640 5 жыл бұрын
Thank you man! It helped me a lot🙏🙏🙏🙏
@virgilpillay
@virgilpillay 4 жыл бұрын
Is it possible to do this with google sheets?
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes. Please checkout our other videos on how to integrate Dialogflow with Google sheets
@tonyaube7813
@tonyaube7813 5 жыл бұрын
Deployment isn't working at 19:16. It says Snapshot and Value aren't defined and that Snapshot is missing a ): The deployment of your Cloud Function failed: Function failed on loading user code. Error message: Code in file index.js can't be loaded. Is there a syntax error in your code? Detailed stack trace: /srv/index.js:41 return admin.database().ref('data').once('value').then((snapshot) ^ SyntaxError: missing ) after argument list function handleReadFromDB(agent){ return admin.database().ref('data').once('value').then((snapshot) const value = snapshot.child('text').val(); if(value !== null){ agent.add(`the value from database is ${value}`); } });
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
After snapshot you need to add =>
@tonyaube7813
@tonyaube7813 5 жыл бұрын
@@AxleWebTechnologies Oh my god I saw it it was there for only 2-3 seconds I must have blinked my eyes. Can't believe I spent a day trying to troubleshoot this. Thanks for taking the time to reply to the email I really appreciate this!
@balloonscheduler4376
@balloonscheduler4376 3 жыл бұрын
function handleReadFromDB(agent){ //return admin.database().ref('data').once('value').then((snapshot) return admin.database().ref('data').once('value').then( snapshot => { const value = snapshot.child('text').val(); if(value != null){ agent.add(`The value from database is ${value}`); } }); }
@chinmaynema4506
@chinmaynema4506 5 жыл бұрын
Hey how can I store multiple parameters in the database? For eg, I need to store the name and user id taken from a user.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Suppose there are multiple child, in that case, the data structure will change slightly. It will be something like this: data |_ 1 |_ first_name: Rahul |_ last_name: Sharma |_2 |_first_name: XYZ |_last_name: ABC You need something unique like ID (Here I used 1, 2 etc but you can use username, email or anything which is unique) to uniquely identify a record. Then the code to write into the database should be something like: return admin.database().ref("data").child(ID).set({ first_name: res.data.first_name, last_name: res.data.last_name }); Where ID can be 1, 2, 3.. and so on.... And code to read from database should be something like: return admin.database().ref("data").once("value").then((snapshot) => { const value = snapshot.child(ID).val(); const first_name = value.first_name; }
@fichafacil7936
@fichafacil7936 5 жыл бұрын
Hi Alex!! When I want to capture new data of a person without knowing the name or other data and write it in the database the new data, how can I do it?
@raghavsharma8512
@raghavsharma8512 5 жыл бұрын
nice job done by u sir.....
@harshitasahai5397
@harshitasahai5397 4 жыл бұрын
Hey! Will this work even if I have intents as a follow up? Because I tried this but it is not showing the changes though getting deployed without any error
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes this should work. Make sure to enable fulfillment in your follow up intents, also in your code, make sure to write the correct code for the intent map.
@kamalpreetcheema9113
@kamalpreetcheema9113 4 жыл бұрын
hi, I have developed the chatbot in dialogflow (which is for diabetes patients), so now I need to save data. so for that should I need to write the same code as you wrote. plsss replyyyy
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Hi Kamalpreet, you dont need to write the same code. The code you will write depends on what you want to achieve. If you need any help, please drop me an email at anshul.shrivastava@axlewebtech.com
@dungha6285
@dungha6285 5 жыл бұрын
Hi bro, i did what you did before but the console log is Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail? How do i solve this bro?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
I believe you can ignore that warning. Please see if it is working or not.
@dungha6285
@dungha6285 5 жыл бұрын
@@AxleWebTechnologies It is not working with my firebase database bro?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Try to select the Firebase blaze plan and see if that works. If still not, email me and will try to help you via screen sharing.
@akshiatreya3398
@akshiatreya3398 4 жыл бұрын
The video was very great! But, I'm getting an error - "Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail" . Could you find a solution to this?
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
You can ignore this. You chatbot should work even with this error.
@akshiatreya3398
@akshiatreya3398 4 жыл бұрын
@@AxleWebTechnologies I cannot see any update of database. Is this because of this error? Because this is the only error I've in the logs.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
No it won't be because of this error. Make sure your intent has fulfillment option enabled. Also make sure billing account is configured
@akshiatreya3398
@akshiatreya3398 4 жыл бұрын
@@AxleWebTechnologies Both the things have been done.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please drop me an email with code block and firebase console logs. Will have a look anshul.shrivastava@axlewebtech.com
@raghvendrakushwah753
@raghvendrakushwah753 5 жыл бұрын
code of function readfromDB is not working. I guess some part of code is hidden. Can you pls post the code of that function in reply to this comment?
@kayderl
@kayderl 5 жыл бұрын
What if I have a second or 3rd degree nested data, are you able to assist on that? Example: data |_ 1 |_ name |_first_name: abc |_last_name: xyz How do I read and write these? Thanks.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please see the pinned comment. Hope that will help.
@bjsmk5932
@bjsmk5932 5 жыл бұрын
hi @Axle Web Technologies! i already have integrated my dialog flow with firebase database but the problem is that the values in my child nodes updates itself automatically with the values that i had stored previously.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
I believe you want to store multiple values, for that please see the Pinned comment above (or below), I have explained there, how to store multiple values in the database.
@bjsmk5932
@bjsmk5932 5 жыл бұрын
@@AxleWebTechnologies okay thanks will get back to you shortly
@bjsmk5932
@bjsmk5932 5 жыл бұрын
@@AxleWebTechnologies thank you for your prompt response, completed the integration successfully
@bahaaeldin2656
@bahaaeldin2656 5 жыл бұрын
nice work keep on
@frankramirez4214
@frankramirez4214 3 жыл бұрын
genial amigo , muchas gracias por el tutorial eres un maestro
@tdoug1929
@tdoug1929 3 жыл бұрын
I receive this warning which I suspect is why I cannot access the database:"Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail",
@AxleWebTechnologies
@AxleWebTechnologies 2 жыл бұрын
It is common warning. You can ignore it.
@URKCSSAIKIRANDEEPAKVEGIROWTHU
@URKCSSAIKIRANDEEPAKVEGIROWTHU 5 жыл бұрын
I understand the read and write but, the thing is it has to store the old data when the new data is entered
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
You can use the ref.child property to add new child and keep appending new data. Please refer to firebase documentation for more details: firebase.google.com/docs/database/admin/save-data
@businesslegal2603
@businesslegal2603 5 жыл бұрын
@@AxleWebTechnologies In order to do what SAI KIRA said, function handleSaveToDB(agent){ const text = agent.parameters.text; return admin.database().ref('data').set({ //return admin.database().ref.child('data').push().set({ first_name: 'Luis', last_name: 'Jimeno', text: text }); } i change the line: return admin.database().ref('data').set({ by this one: return admin.database().ref.child('data').push().set({ but it does not work
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
@@businesslegal2603 Basically the data structure will change slightly. It will be something like this: data |_ 1 |_ first_name: Rahul |_ last_name: Sharma |_2 |_first_name: XYZ |_last_name: ABC You need something unique like ID (Here I used 1, 2 etc but you can use username, email or anything which is unique) to uniquely identify a record. Then the code to write into the database should be something like: return admin.database().ref("data").child(ID).set({ first_name: res.data.first_name, last_name: res.data.last_name }); Where ID can be 1, 2, 3.. and so on.... And code to read from database should be something like: return admin.database().ref("data").once("value").then((snapshot) => { const value = snapshot.child(ID).val(); const first_name = value.first_name; } I will create an advanced version of this tutorial soon with more details.
@businesslegal2603
@businesslegal2603 5 жыл бұрын
@@AxleWebTechnologies Thank you very much for your answer. I will try your suggestions, and wait for your advanced version. Regards
@rosanasr
@rosanasr 5 жыл бұрын
Hello, again! Do you have something on Yes and No answers? I searched but I couldn't find it. The problem I'm facing is that a lot of interactions have Yes and No flows, but the bot is mixing them. Or if I have same single words (even if they are in different entities and diferent intents) i gets mixed. I'm not sure if it is something in the contexts, the lifespam, the followup intent or any other issue. If the user answers with a simple yes or no, it gets mixed. If they say "yes I use paypal" it gets right. But in real use case I cannot demand a complete answer. Any tips? Thank you so much!
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Ok, here is what you can do. Let's say you have an intent "Use Paypal". When you ask a question, "Would you like to use Paypal", set an output context, "use-paypal" in that intent. Now create two more intents named "Use Paypal - Yes" and "Use Paypal - No" In "Use Paypal - Yes", input context should be "use-paypal" and training phrases should be "Yes, yeah" etc In "Use Paypal - No", input context should again be "use-paypal" but training phrases should be "No,nope" etc and then in both intents Use paypal - yes and no, you can write corresponding response in the response section. You can watch my video on contexts and follow up intents here: kzbin.info/www/bejne/oXrPi2t8nLOJrpI
@rosanasr
@rosanasr 5 жыл бұрын
@@AxleWebTechnologies thank you, I'm still having trouble. Im going to answer in the context video so we don't mix up subjects here!
@jessyguna1499
@jessyguna1499 5 жыл бұрын
how can i connect it with sql
@philiplartey19
@philiplartey19 5 жыл бұрын
Why does the data get overwritten all the time. I need to use this approach but need to find a way to store data from multiple users without overwriting them. Please help
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please see my pinned comment for details.
@asiskumarroy4470
@asiskumarroy4470 4 жыл бұрын
I have been getting this error for the last 20 days and could not solve it.Please Please Please can u tell me how to deal with it.This is really important as my entire project is based on this. When I click on the deploy button it shows an error"Error happened during Cloud Functions Deployment"..Please let me know how to debug it.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
It looks like you don't have permission for deployment. Please make sure you are the owner of the Google cloud project. If you are not, make sure you get owner permission from whoever is the owner of the project. Feel free to comment if you still see the issue.
@oumaymameddeb2311
@oumaymameddeb2311 4 жыл бұрын
hi, i want to build a bot using alexa skill, dialogflow and firebase (with nodejs).Can you help me please !
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Sure We can help you. Please send your detailed requirements to anshul.shrivastava@axlewebtech.com
@oumaymameddeb2311
@oumaymameddeb2311 4 жыл бұрын
@@AxleWebTechnologies done !!! Thanks for your quick response
@davidmurati9403
@davidmurati9403 5 жыл бұрын
Buenos dias, disculpe la molestia tengo un error que dice: "Webhook call failed. Error: Request timeout" esto sucede cuando trato de leer los datos. Algguien seria tan amable de ayudarme y decirme que hago mal.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please check firebase console logs and see if there is any error?
@davidmurati9403
@davidmurati9403 5 жыл бұрын
@@AxleWebTechnologies Ya los verifique muchisimas gracias!!! ya se conecto. de verdad gracias por tener la amabilidad de contestarme.
@garotospunkrock
@garotospunkrock 4 жыл бұрын
Cara !!! tu é muito muito muito bom !!! :) Me ajudou muito !!! Metodologia nota 10 !!!
@Rickedydoo
@Rickedydoo 3 жыл бұрын
Why cant my bot read from database? It just says "not available" under default response after typing 'Read from Database' ;-;
@AxleWebTechnologies
@AxleWebTechnologies 3 жыл бұрын
There could be various reasons for this. Please drop an email to anshul.shrivastava@axlewebtech.com with some logs and screenshots. will have a look.
@singhprakash194
@singhprakash194 5 жыл бұрын
I want to call external Rest Api(cloud application along with the Body ,Custom Header,Authentication) and want to get response in the chat from dialogflow ,any leads on it will be appreciated.
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Yes, you can do that using axios library. Following link might help you: stackoverflow.com/questions/44617825/passing-headers-with-axios-post-request PS: Make sure to Enable billing account otherwise Dialogflow can't connect to external network.
@srinivasvaddadi163
@srinivasvaddadi163 5 жыл бұрын
sir, can you please tell, how to use webhooks and integrate webhook API to an external database in my pc...
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
It depends on which database you are using. Your database needs to be available online. Host it on AWS RDS Service and then try to access it. You may need to write APIs to access it from Dialogflow webhook.
@srinivasvaddadi163
@srinivasvaddadi163 5 жыл бұрын
@@AxleWebTechnologies . can you help me in writing API for webhook in java?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
@@srinivasvaddadi163 I can help you write API in Nodejs and javascript but not Java
@srinivasvaddadi163
@srinivasvaddadi163 5 жыл бұрын
@@AxleWebTechnologies thanks for that. But I'm working on my project using Java. So just send me the JavaScript link,so by following the structure I'll try to write in Java..
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
I don't have a link, just try searching on KZbin. You will find many resources. For connecting Dialogflow with external API, you can refer to my video on same topic
@MohammadHaryono
@MohammadHaryono 5 жыл бұрын
how to reset context when i want to cancel to write to DB ?? thakns
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
You can write agent.context.delete('context-name')
@tonyaube7813
@tonyaube7813 5 жыл бұрын
Hey Anshul, at 13:11 I accidentally pressed the "Add" button and my "data-first_name" disappeared. Did I save this in the database? Could that cause problem down the line?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Yes that should be saved in database and you should be able to see it.
@asiskumarroy4470
@asiskumarroy4470 4 жыл бұрын
Error:Error happened during Cloud Functions Deployment. This error occurs when I click on deploy button
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Please see my reply on your previous comment ~Anshul
@hiphopsmiti
@hiphopsmiti 5 жыл бұрын
hi , i ve watched all your videos ! you helped me a lot but one thing is missing and don't get it , i want my chatbot in arabic language and i couldn't add translation to dialogflow , please help me ! thank you so much
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Arabic is currently not supported in Dialogflow. Hopefully they will add it soon.
@hiphopsmiti
@hiphopsmiti 5 жыл бұрын
@@AxleWebTechnologies can i add translation ? And how ?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
@@hiphopsmiti Please refer to this documentation cloud.google.com/dialogflow/docs/agents-multilingual
@superAbtruse503
@superAbtruse503 4 жыл бұрын
I cant even enable the inline editor it shows this: Cloud Functions integration requires billing to be set up (more info on pricing and usage here: cloud.google.com/functions/pricing). Please go to Google Cloud Console to set up billing first.
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
Yes, you have to setup billing account for that. Please watch our video on how to connect Dialogflow with external APIs. In that we have explained how to enable billing account.
@laxmanawate5706
@laxmanawate5706 5 жыл бұрын
function readdb(agent) { const mobileno=agent.parameters.text; return admin.database().ref('data').transaction((data) => { const mobileno=agent.parameters.text; let mob=data.mobile; let bal=data.balance; if(mobileno==mob) { agent.add(`Your account balance is`+bal); } else { agent.add(`not register`); } return data; } ); Firebase DB data is parent child is mobile no & balance now in that i have multiple mobile no and each no have different balance then how it work?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
I have replied to other similar comment. Please have a look at that one.
@ShuyaFay
@ShuyaFay 5 жыл бұрын
Hi,I am having difficulties in saving the input data into database. The diagnostic info showed me 'Webhook call failed. Error: Request timeout'. Is there any solution for this?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Can you please show the code you have written to save the data?
@ShuyaFay
@ShuyaFay 5 жыл бұрын
Sure, I copied to this pastebin. Have a look pastebin.com/G0APw2cZ
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Make sure you use backticks here ` agent.add('The value from database is ${value}'); It should be agent.add(`The value from database is ${value}`);
@ShuyaFay
@ShuyaFay 5 жыл бұрын
@@AxleWebTechnologies I changed it but the problem still persists. This is the RAW API RESPONSE it gave me from Diagnostic Info: pastebin.com/8FKDZtpi
@shonephuxuantran186
@shonephuxuantran186 4 жыл бұрын
why we have to change the https to ws?
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
We stands for websocket. We need to use web socket protocol here
@shonephuxuantran186
@shonephuxuantran186 4 жыл бұрын
@@AxleWebTechnologies Do you know how dialogflow handle when the input is broken into multiple entries ? e.g: I am happy today
@farazfaraz6220
@farazfaraz6220 5 жыл бұрын
how can we connect dialogflow with sql server database?
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
You can create an API using express which is connected to MySQL or sql sever and then you can connect Dialogflow with your APIs. You can watch my other video on how to integrate Dialogflow with external APIs
@alanreyes6637
@alanreyes6637 5 жыл бұрын
Ya lo logre hacer, eres un genio!!
@ritikmehta9684
@ritikmehta9684 4 жыл бұрын
Hey I like your videos alot... Hello Sir I need your help regarding the chatbot project. Actually, in my project, I need different chatbot screens for the different users so that one user cannot see the other user messages and ita very difficult to me please help Please reply...! Thank you
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
You can implement OTP based login in your chatbot and then show the message only related to that particular user.
@businesslegal2603
@businesslegal2603 5 жыл бұрын
Dear Axle, thanks a lot for your video. I followed step by step your video but I got the following error. I rechecked and everything is equal to your video...Could you please advise? The deployment of your Cloud Function failed: Function failed on loading user code. Error message: Code in file index.js can't be loaded. Is there a syntax error in your code? Detailed stack trace: TypeError: admin.initializeAPP is not a function at Object. (/user_code/index.js:8:7) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at getUserFunction (/var/tmp/worker/worker.js:435:24) at loadUserCode (/var/tmp/worker/worker.js:491:18)
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
It should be admin.initializeApp and not admin.initializeAPP (Lowercase pp in App). Hope that will fix the issue.
@businesslegal2603
@businesslegal2603 5 жыл бұрын
@@AxleWebTechnologies Thnaks. It works perfect.
@MohamedSaad-hc3ol
@MohamedSaad-hc3ol 5 жыл бұрын
please help me in this , i want make agent help user to create his CV so i want the agent ask the user some Questions and save his answers in data base , but there is a problem in this agent we want ask him about his skill for Example so as this "Do you have skills want to add it ?" and if the answer of the user is yes ask him "what is your skill name ?" and if his answer is no ask him about different section such as "Do you want to add any studies for you ?" and make the same operation but aslo if he enter the name of skill for example we must ask him if he want to add anther skill or no as this "do you have anther skill want to add ?" please help me this is sooo important for me sir
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please send me an email at anshul.shrivastava@axlewebtech.com
@adisimanjuntak1283
@adisimanjuntak1283 4 жыл бұрын
Hy there, i have seen your video. I have problem nowdays dialogflow use Api V 2.0, how i solve this problem, i check in raw api response this "message": "Webhook call failed. Error: DEADLINE_EXCEEDED."
@AxleWebTechnologies
@AxleWebTechnologies 4 жыл бұрын
This is due to webhook taking more than 5 seconds to respond. Please don't perform heavy operations on webhook which might take more than 5 seconds to respond.
@shafmairaj6493
@shafmairaj6493 5 жыл бұрын
I need help to solve this error, whenever i try to deploy it gives me this error.. Error: The deployment of your Cloud Function failed: Function failed on loading user code. Error message: Code in file index.js can't be loaded. Is there a syntax error in your code? Detailed stack trace: TypeError: Cannot read property 'app' of undefined at Object. (/srv/index.js:8:18) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at getUserFunction (/worker/worker.js:439:24) at loadUserCode (/worker/worker.js:495:18)
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
It looks like there is a syntax error. Please check your code (Line number 8)
@chatbot3098
@chatbot3098 5 жыл бұрын
why this error appears in firebase : Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
@AxleWebTechnologies
@AxleWebTechnologies 5 жыл бұрын
Please do a Google search for this error. There are several fix to this issue.
Dialogflow Tutorials: Integrate Your Dialogflow Agent with External APIs
22:33
AxleWeb Technologies
Рет қаралды 64 М.
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 7 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 8 МЛН
Fulfillment: How to Integrate Dialogflow with Google Calendar
5:50
Google Cloud Tech
Рет қаралды 61 М.
Dialogflow Tutorials: Integrate Dialogflow with MySQL Database
21:21
AxleWeb Technologies
Рет қаралды 29 М.
Dialogflow Tutorials: Integrate Dialogflow Chatbot with Google Spreadsheets
17:13
Set up Firebase for Dialogflow Chatbot
18:12
Code Daily
Рет қаралды 1,5 М.
How to connect Dialogflow and Google SpreadSheet
10:39
Raj Kapadia
Рет қаралды 4,2 М.
Dialogflow Tutorials: Integrate Dialogflow Chatbot with Facebook Messenger
13:40
Save Dialogflow Chatbot Conversation in Databse(Updated) 2020
20:14
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24