Dialogflow Tutorials: Integrate Dialogflow Chatbot with Google Spreadsheets

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Laughter] [Music] [Applause] [Music] let's in this video tutorial I am going to show you how to create a dialog flow chat bot which is connected to a Google spreadsheet you can use Google spreadsheet to store any kind of data and basically you can show responses in dialogue flow using the data which is stored in the Google spreadsheet so let's see how to do that so first step is to go into the dialogue flow console [Music] and let's create a new agent called spreadsheet demo all right so now we need a Google spreadsheet so let's create a new spreadsheet [Music] and let's put it some some data inside that spreadsheet so spit some name age email and phone number so let's say this is the header and just feelings quickly some data [Music] all right so let's say this is our data stored in the spreadsheet and now we need to fetch this data in the dialog flow so let's build a chatbot which will ask for name and when we pass a name then it will tell the age email and phone number of that person so let's see how to do that so you can use a very good tool which is called sheet DV dot IO so this tool can basically convert your spreadsheet into an API so just log in with your Google account and just copy this URL and click on create new and paste it here and create API so let's share this document and just get a shareable link yeah alright so yeah make sure you share this document with everyone all right and then click on create API and there you go so this is the API just click on it and it is copied to clipboard now paste it and yeah so this data is coming from the spreadsheet so if you make any changes it will be reflected here so let's say we quickly add something else [Music] okay and if you refresh it yeah there's a new entry so this is the API now we just need to connect our dialog flow with this API so let's say you go to dialog flow default intent and here we add a parameter called name just call it start any and name required parameter please meet the name so we are going to ask for the name please tell me the name whose details you would like to see alright so now we will just delete this default response and enable fulfillment so that we can write our code now let's go to fulfillment section and enable fulfillment [Music] [Music] you may need to wait for couple of minutes okay so now we are here in the fulfillment so you will write our code in this welcome function which is triggered using default welcome intent so whenever this intent is triggered will come function will be executed and this is the Welcome function so we need to make a call to the API get the data and display it here now to make the call we need Axios X uses a library which we use for making API call so just write this Const X Y is equal to require X 0 okay and in packaged or Jason just define X zeros here and you need to use the latest version which is I guess 0.19 dot 0 you can always see the latest version here and PMX zeros [Music] so 0.19 dot 0 is the latest version so that's what we are using here alright and yeah we have just mentioned XE us here ok so the next thing is we need to make the API call so for that you can create a function called get spreadsheet data okay and all that function has to do is to return X your start kit and URL which are so this CD bit at i/o URL ok and here instead of a gendered we can write something like this return check spreadsheet data right and thought then this is called promise and what we are doing is making call to the spreadsheet API using this function and when the call is done then we will get the response in this arias or response parameter and for now just do a console log just to see if we are getting the data back or not so make the call to the spreadsheet API get the response in this console log and let's deploy it all right so the deployment is complete now let's open the execution logs so that we can see the console logs if you are logged in with multiple account make sure you log in with the correct account [Music] [Music] okay so let's trigger this intent let's say hi it says please tell me the name that's unsure alright so there's no response and we haven't configured any response so let's go directly to the console logs and there you go so you can see we got an error and it says cat address info again 443 something like this so that means it is unable to access the Internet and that's because we need to confer a configure a billing account so for that go to console or cloud or google.com slash billing okay and make sure you are logged in with the correct account if you are not just change the account [Music] right and make sure you have a billing account here so then go to my projects and just select the project that you have created ours is spreadsheet demo so click on change billing and set account and that's it so now you can close this and try again say hi please tell me the name you sure all right no response but let's see here [Music] there you go so you can see we got the data from the API okay and this is basically everything so you don't need everything oh we just need the data right so we can write something like this response dot data so control log response dot data and apply it wait for few seconds and then check it again all right so deployment is complete let's test it again so hi just enter the name and check in the locks [Music] there you go so you can see we've got the name age email and phone for all the users now it's just matter of looking through this data and displaying the correct information so now what you can do is you have got the data here in restore data you can write something like there's our data dot map you can use map function so you can say person so for each person HN dot [Music] so we have got name property right so if you can write something like if person dot name equal to whatever user has provided so user provided name can be stored here this Const name equal to H n dot parametres dot name so this this name will be stored here okay so this is the name which we collected from user and we are going to use that name and we are going to compare with name you can write something like this and make sure that this is back take and not the single quotes so we will use here are the details for name ok and ish yeah right person dot age this email and phone person dot email comma phone person not phone all right so that's it basically so let's deploy this and let's see if it works or not all right so deployment is done so let's test it hi enter the name so it's a unsure and there you go here are the details for initial h30 email ABC at exercise at four one two three let's try it again let's do it for Sean so we should see these details please tell me the name John and there you go here are the details for John is 28 emails John at gmail.com phone idiot something so you can see how easy it is to connect the dialogue flow agent with spreadsheets and you can store any kind of data here and then use it in your dialogue flow and now when you connect this dialogue flow with your Facebook or telegram or viber or any other platform you will see this response in those platform so I believe you liked our video if you liked it please click on like button and share it with your friends and please subscribe to our Channel thank you
Info
Channel: AxleWeb Technologies
Views: 27,118
Rating: 4.9444447 out of 5
Keywords: dialogflow, integration, google spreadsheet, connect dialogflow with google spreadsheet, chatbot with google spreadsheet, messenger bot with google spreadsheet, integrate Dialogflow with excel sheet, excel, microsoft excel, ms excel
Id: FatMj-10gQ4
Channel Id: undefined
Length: 17min 13sec (1033 seconds)
Published: Sat Aug 31 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.