Thank you so much! Great presentation. Easy to follow instructions. Please make a lesson also on how to use Dialogflow to store data in the google spreadsheet.
@@AxleWebTechnologies hi so how do i make the name, age, phone and email become a header? Mine shows as a string and I am unable to call it in dialogflow
thank you for sharing this. Can you share where can I put the else statement so that if the name does not exist, chatbot will return a not exist message.
When I go to deploy I get the error Error happened during Cloud Functions Deployment and there is a message at the top Newly created cloud functions now use Node.js 10 as runtime engine. Check migration guide for more details. Do you have instructions on how to fix this?
Thank you for the video...I have One question i.e. if I want to continue the names one after one without giving "Hi" after 1st result. How can I do that?
Thank you so much. I am trying the Google spreadsheet read/write myself with Dialogflow in the exactly same way as you showed in the video. I am encountering a problem when I have multiple entries with the same name in the spreadsheet, and the fulfillment fails to read the multiple entries. A few days ago, the same code worked fine and it listed all the entries with the same name, but now it fails. Could you help me with this problem?
Fantastic job! Thank you very much! I keep getting the Firebase error: "Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail" Is it just me? How did you all solved that? Kind regards,
Hi , I am bit new to this, really appreciate your help. I activated the billing as you mentioned , Also please note, I cannot see any firebase mentioned here. Instead of firebase it is "View execution logs in the Google Cloud Console" . I logged into Google cloud console and I found an error log like this. "textPayload: "Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail" " - Please advise what to be done ?
Hi Mathew, Yes they recently changed it from firebase to Google cloud logs. Please try visiting console.firebase.google.com/project/ And then go to functions and then logs
@@AxleWebTechnologiesHey, I got the same error in the logs what you mentioned :/(dialogflowFirebaseFulfillment Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail) May i ask you, how can we solve the problem via code? Best wishes.
Hi friend, congratulations on the tutorial, it helped me a lot. I have a problem and would like your help. I need to create a condition when the value is not found in the database, I did the test with If and they however both return me ten times the answer to the limit of the database, example if the database has 100 rows he return the answer to me 100 times. Could you help with that?
@@AxleWebTechnologies Hi thanks! but my problem is that the If condition is returning the answer I need. But that answer comes back a dozen times. I would like the query to the database to return negative it only returns the default text (only 1 time) that the value was not found. Today he is returning the information that the value was not found only that this information returns ten times.
Hello, have you used to migrate this API using webhook? I use the glitch platform to make external calls. and you could use it to use that API. Then you wouldn't have to make a payment to use SheetDB. I'm trying to apply, but it changes some things in the Inline Editor, and that's why I'm not getting it. Thanks!
Hi. I'm new to node.js and javascript in general. How should I retrieve multiple "persons", for example, from a list of students, return names of all males
Thank you for this tutorial, it is very useful! I have one questions. Once I want to deply the inline code I get the following error: Error happened during Cloud Functions Deployment. Do you know how to solve this problem?
You can try deleting cloud function at console.cloud.google.com and redeploy the code. Remember your old code will be lost so make sure you have a backup
I found the cause of the problem. It looks now that you cannot make the agent.add call more than once in a function run next to each other. And that seems to be how Dialogflow is now works now, and that is completely a new thing that we have to live with, maybe. Anyone knows about this sudden change of policy, and why? It is very inconvenient anyway, not being able to call agent.add twice in a row.
Hey, do you know what entity needs to be used if your value is a mixture of numbers and letters for example S0010? The logs show I have the data but my system is not showing output. Thanks!
Hi AxleWeb team. I have followed your way and have wriiten identical code to read through google spreadsheets. However, I am getting below error: Error: No responses defined for platform: DIALOGFLOW_CONSOLE at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13) at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38) at process._tickCallback (internal/process/next_tick.js:68:7) Any help will be really appreciated. Thanks in advance
Hi, Thanks for the Video. Great Presentation and explanation. I want to know how we can reply users with Video / ppt / HTML along with text? Is it possible using Dialog Flow?
@@bytechocr5878 For Website or Android App, you need to use Dialogflow APIs. We have built a custom user interface using HTML/React which can be embedded on websites. The custom Web UI interacts with Dialogflow using Dialogflow APIs. Please watch our video on how to integrate Dialogflow with Websites.
Thanks! @@AxleWebTechnologies I will check from your list of videos. I have sent an email to you from your website, let me know if got a chance to reply that. My email id is naveen.jain@bytechindia.com
Great video, extremely helpful! I got everything working fine, but I'm wondering if you had sample code that can be added that will ask for and return only the attribute you want. For example, I just want to ask for the Email for a specific person, but the next time it'll be the phone number.
Thank you so much for this video, I found it incredibly helpful. I am just having an error when a user puts in a name that is not in the database. The console won't reply. How can I get it to send back an error message to the user?
Thanks Matthew for your appreciation. Glad you found the video helpful. For your scenario, you can write an if else logic... If user is found in database reply with message 1 else reply with message 2. Hope this makes sense.
hi , axleweb technology thanx for tutorial i have same code for fill the fulfilment bust some error waserror happened during cloud functions deployment fulfilment not deploy..so please some help me how to solve this
Hey, would You mind answering me a question ? :) Instead of creating google sheets API with sheetdb.io I've created API with python. Is there a way to connect it with Dialogflow? From VScode I can read and write data to my sample sheet and it's working :) but how to integrate it with dialogflow ? 🙈
Yes the features are free.... However you need to enable billing account which means you need to card details... Google won't charge you unless you cross the free usage limits... The free tier limit is quite High... You mostly won't exceed it unless you have thousands of daily active users
Thanks a lot for the video. I tried it, but it didn't work. Followed all the steps on the codes, and the DIAGNOSTIC INFO said that the webhook was executed successfully, but still didn't get the right response. From the fulfilment section, I can only access to the logs on Google Cloud, not Firebase, and it's difficult to navigate this platform and couldn't find the logs from the Dialogflow project. :( (It seems Google has made some strong changes recently). What should I do to make it work? Thanks!
Make sure you have enabled fulfillment in the intent. For firebase logs go to console.firebase.google.com/project/YOUR-PROJECT-ID Then go to functions -> logs
@@AxleWebTechnologies Many thanks for your quick response! I checked the Intent section - the fulfillment was enabled, but I noticed that the value section for the name parameter appeared empty. So added the value $name, then re-wrote the code from your video on the fulfillment section, and the information started to appear correctly on the log on Firebase! But then when I tested with the test name value (Test1) on the google sheet, it didn't work. Then I changed the names on the spreadsheet to regular name text, it worked! I also noticed that the texts for the names are case-sensitive! Quite interesting details about this name issue. Thanks!!!
Sorry your question is not clear? Where do you want to make a folder? Chatbot runs on a server so yes in theory it is possible to make a folder in server OS however, it is not possible to make a folder on client OS from chatbot
Hey there, I keep getting this error. dialogflowFirebaseFulfillment TypeError: res.data.map is not a function at getSpreadSheet.then.res (/workspace/index.js:26:16) at process._tickCallback (internal/process/next_tick.js:68:7) Can you help out as to why this is happening?
I am doing a different implementation and need to ask a question: How can I get him to search for more than one term in the "name" field? For example: If I put "John, Paul" he will find neither John nor Paul in the search. is it possible to do that?
I have executed the code and is without errors. But at end , the response body is not generated from API . Basically, I am not getting the desired output after 12:00 in the video . Please help with the issue.
I copied the code word to word and it keeps spiting out "not available" under the "default response" section, if you could help that would be great . Thank you.
It seems your fulfillment is failing or not working for some reason. Please check a few things - Make sure Enable fulfillment option is enabled in your intent - Make sure your billing account is enabled so that your Dialogflow agent can access external APIs - Make sure there are no errors in Firebase console logs.
@@rma1563 Dialogflow web integration doesn't work very well. Please watch my video on how to integrate Dialogflow chatbot with websites. For messenger, you can do SHIFT + ENTER for the new line.
You can write your own custom webhook integration. With that you don't need to enter your card details. However, the process is slightly complicated. You can watch our video on how to create webhook in PHP for Dialogflow.
Currently sheetdb.io does not allow you to POST data to spreadsheet. You can use another tool called sheet.best. It allows you to GET and POST data from spreadsheet. I will create a tutorial on writing data into spreadsheet soon.
Hello Anshul, much appreciate your tutorial! It is perfectly working on a newbie! This fulfillment is successfully deployed on a new agent. However it shows "Error happened during Cloud Functions Deployment" when I worked on the original one. The agent has been integrate with twillio. Thank you.
@@jasolutions1145 when you go to inline editor, you will find package.json. In that each package will have a version number. Make sure old package.json has same version numbers as that in package.json of new agents.
Great Video. I can not make this work. This is the error message I'm getting: "message": "Webhook call failed. Error: DEADLINE_EXCEEDED." Any Idea what I'm may make wrong. I've created the same sheet and made it all with a new testagent from scratch exaclty as shown in the Video. The logs also do not receive the Spreadsheet data :-(
Make sure you have enabled the fulfillment option in the intent and also make sure your billing account is configured. If you still see the issue, please share the code so that we can understand what's going on there.
function GetGSheetData() { return axios.get('sheetdb.io/api/v1/kzau8dj7mqfjg'); }
function welcome(agent) { const name = agent.parameters.name; return GetGSheetData().then(res => { res.data.map(person => { if(person.Name === name) agent.add(`Here are the details for ${name}, Gender ${person.gender}, Email ${person.email}`); }); }); }
function fallback(agent) { agent.add(`I didn't understand`); agent.add(`I'm sorry, can you try again?`); } // Run the proper function handler based on the matched Dialogflow intent name let intentMap = new Map(); intentMap.set('Default Welcome Intent', welcome); intentMap.set('Default Fallback Intent', fallback); agent.handleRequest(intentMap); });
Try writing person.Gender and person.Email instead of person.gender and person.email Thats because your spreadsheet has column Gender and Email with capital G and E respectively.
Hello Sir thank you very much for this video, Can you make a video on how to make dialogflow chatbot initiate conversation before user types any message, would really appreciate your assistance
You can watch our video on how to integrate Dialogflow with Websites. In that we have shown how to create a chatbot which initiates conversation without user typing anything.
The chatbot shown in the video will automatically show a greeting message when launched. You dont need to do anything. What happens is basically When the bot launches, it sends "hi" message behind the scenes. You dont see this hi message in the chatbot ui. Whatever response comes from Dialogflow, the bot shows that response.
@@AxleWebTechnologies Totally agree with you Sir, but I want to know how did u implement it, because in the official document I could not find any way to trigger welcome message at start of conversation
It is just a matter of calling Dialogflow V2 API and getting response. We will create a video tutorial on how to make calls to Dialogflow V2 APIs sometime in future
I cannot seem to display any details retrieved from the spreadsheet like at 16:08 of the video. But i have done everything correctly and it even deployed successfully. I'm stuck and i really don't know what to do. Please help. this is the error on the logs: dialogflowFirebaseFulfillment Error: No responses defined for platform: DIALOGFLOW_CONSOLE at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13) at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38) at process._tickCallback (internal/process/next_tick.js:68:7)
This seems to be a problem recently introduced by Dialogflow. Many people are complaining about this and I have never seen this before. Can you please try this: if you have multiple agent.add() in your code, just keep one and delete others and see if it works.
Hi Pooja, this video itself is about storing data from Dialogflow to Google spreadsheet. Please let me know what specifically are you looking about? ~anshul
@@AxleWebTechnologiesThank you for your reply.I watched lot of videos however i am not able to find out my solution.You taught really well.I need to add phone number to google calendar from dialogflow automatic from cal logs.Don't know what to do...:(
Hey. When entering into (package.json) "axios": "0.19.0" - writes - "Expected "}" and instead saw "Axios', "Expected "}" and instead saw ':' and "Expected "}" and instead saw "0.19.0', What needs to be done I do not quite understand.
@@AxleWebTechnologies Thank! Question: can I make authorization by phone? For example, the bot sends the client a code via SMS, which it generates, the client enters the code number and the guest can work with the bot.
@@u.v8383 yes you can do that. You need to handle all that in your fulfillment code. You can call an API to generate OTP and then ask the user to input OTP. and then collect the OTP using a parameter. Then you can compare the API generate OTP and user-entered OTP.
@@AxleWebTechnologies Спасибо! скажите возьметесь за разработку небольшого бота, или можете помочь а написании? Если да, укажите пожалуйста почту, я вам скину техническое задание, и сразу обговорим финансы.
Hi, while deploying i m facing an issue my api response is webhook call failed and in the logs its showing as cannot read property of the column that i mentioned in the sheet.please help me to resolve this.
Please share the code and the firebase console logs. Please note: we have created a Slack channel for all your queries. Please join the slack channel using below link and post your queries in the channel: join.slack.com/t/dialogflow-awt/shared_invite/enQtOTUwMzAwOTI3Mjk2LWRiOGYwOGIyOGU4ZjNkNWI3NTJiMTgyMmMyNTM2OWE2YzZmZjkwNmEyMWZmOWIyZTRmNzY3MTY2ZDYzNWVhYzQ
@@AxleWebTechnologies this is my function block function hoteldetails(agent) { const PhoneNumber = agent.parameter.PhoneNo; return getSpreadsheetData().then(res=> { res.data.map(person=> { if(person.PhoneNumber === PhoneNumber) agent.add(`Here are the booking details of ${PhoneNumber}.Name : ${person.name}, RoomNo: ${person.RoomNo} , HotelName: ${person.HotelName} , HotelContactNo: ${person.HotelContactNo}`); }); }); } Cloud Logs: 2020-07-02T13:28:32.944Z dialogflowFirebaseFulfillment c1uor5kdz4sc TypeError: Cannot read property 'PhoneNo' of undefined at hoteldetails (/srv/index.js:22:41) at WebhookClient.handleRequest (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:303:44) at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/srv/index.js:71:9) at cloudFunction (/srv/node_modules/firebase-functions/lib/providers/https.js:57:9) at /worker/worker.js:783:7 at /worker/worker.js:766:11 at _combinedTickCallback (internal/process/next_tick.js:132:7) at process._tickDomainCallback (internal/process/next_tick.js:219:9) E dialogflowFirebaseFulfillment c1uor5kdz4sc undefined 2020-07-02T13:28:32.958831578Z dialogflowFirebaseFulfillment c1uor5kdz4sc Function execution took 2386 ms, finished with status: 'crash' D dialogflowFirebaseFulfillment c1uor5kdz4sc
Hi, I'm a suscriber, you helped me a lot my friend, now I'm having an error when I try to do more than one question to the bot without saying welcome, hi, etc
Hello Subscriber, glad our videos helped you. Can you please clarify what do you mean by try to do more than one question? Also please provide some details about error you are seeing.
@@AxleWebTechnologies Hi! sorry if i was not clear, i connected the bot with a perfume data base. when i say hi to the chat bot, it let me search any perfume´s name and it return me the price. but if i want to search another, i have to say hello (or other traninig phrase) again. i would like to know how to consult without a training phrase. thanks!
@@valentinpouso2043 ok so the best thing you can do is after showing pricing for a perfume, ask a question, "would you like to search for another perfume?" if user says yes, then trigger the perfume search intent, if the user says no, then close the conversation. You need to use context and follow up intent for that. Please watch this video series for more details ua-cam.com/video/Yjji510scI0/v-deo.html
a mi me sale este tipo de error alguien sabe por que: Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500.
Make sure the service account is created and you have owner permission to the agent. You can try creating another agent in Dialogflow and see if that works.
I get data to my Firebase that is broken out correctly. It shows all the data in my google sheet. It still will not give me a response for characteristics from the sheet though!!!! Grrrr!!!
Make sure to use back ticks ie. ` and not single quote ie. ' while writing output message. Basically write `${YOUR_VARIABLE}` and not '${YOUR_VARIABLE}'
Great tutorial. Can u guide for more information to pull out results through rows of data under a column header, for example: 1. Three columns: City | Date | population 2. Rows contain, population of cities for different dates, 3. Question asked: Q 1. What is the total population of city 1, it collects the data from the many rows and applies the add function to give an output, Q2. What is the average population of the city 1 for the first quarter of 2019 ? It averages and provides the result, Q3. Which city leads the Rate increase in Population: It compares and shows the trend result. Would be grateful if could guide for above example or similar. Thanks Mohit
This is great content, and I thank you for it. I have encountered an error when deploying: "Error happened during Cloud Functions Deployment " Under package.json I see the error at line 21: { "name": "dialogflowFirebaseFulfillment", "description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase", "version": "0.0.1", "private": true, "license": "Apache Version 2.0", "author": "Google Inc.", "engines": { "node": "8" }, "scripts": { "start": "firebase serve --only functions:dialogflowFirebaseFulfillment", "deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment" }, "dependencies": { "actions-on-google": "^2.2.0", "firebase-admin": "^5.13.1", "firebase-functions": "^2.0.2", "dialogflow": "^0.6.0", "dialogflow-fulfillment": "^0.5.0" "axios": "0.19.0" } } Error log as follows >> (Expected '}' and instead saw 'axios'. Expected '}' and instead saw ':'. Unrecoverable syntax error. 91% scanned. How can I fix this?
You have to add a comma (,) just before "axios" and after "dialogflow-fulfillment": "^0.5.0" so it should be : "dialogflow-fulfillment": "^0.5.0", "axios": "0.19.0"
"axios": "0.19.2" is making issue. Error Message: The deployment of your Cloud Function failed: Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`gen_package_lock` had stderr output: npm ERR! file /workspace/package.json npm ERR! code EJSONPARSE npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected string in JSON at position 667 while parsing '{ npm ERR! JSON.parse \"name\": \"dialogflowFirebaseFulfillme' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in: npm ERR! /builder/home/.npm/_logs/2020-03-17T06_56_33_997Z-debug.log
error: `gen_package_lock` returned code: 1", "errorType": "InternalError", "errorId": "5E1A5043"}} Please help as due to this error I'm not able to deploy.
Hey great video!! After adding the initial code and functions, I get this error when i try to deploy the code: Error happened during Cloud Functions Deployment. My billing account is activated (I have used other features like sending media, etc) cause i have used other features as well and they work fine. My previous code was working fine before I added the axios dependency and added the sheet.io feature! Please help me out! function getSpreadsheet(){ return axios.get('sheetdb.io/api/v1/283rh8ewnpbo2'); } function getPrice(){ return getSpreadsheet().then(res => { console.log(res); }); } . . intentMap.set('PriceEnquiry', getPrice); This is the error on my firebase console: dialogflowFirebaseFulfillment Dialogflow Request headers: {"host":"us-central1-nscustomercare-kcohnw.cloudfunctions.net","user-agent":"Google-Dialogflow","transfer-encoding":"chunked","accept":"*/*","accept-encoding":"gzip,deflate,br","content-type":"application/json","forwarded":"for=\"66.249.83.54\";proto=https","function-execution-id":"dau4x8v91pb3","x-appengine-country":"ZZ","x-appengine-default-version-hostname":"y7530e94f078d7f1cp-tp.appspot.com","x-appengine-https":"on","x-appengine-request-log-id":"5ef5cb2200ff00fff9f82688b0370001737e7937353330653934663037386437663163702d7470000139303866373866633530636138623435363966303164656633393333393136383a33000100","x-appengine-timeout-ms":"599998","x-appengine-user-ip":"66.249.83.54","x-cloud-trace-context":"54e5caafbb06b337baa57ab8ce47d16c/1191335711639240445;o=1","x-forwarded-for":"66.249.83.54","x-forwarded-proto":"https","connection":"close"} 3:47:13.747 PM dialogflowFirebaseFulfillment Dialogflow Request body: {"responseId":"b7a9d2b7-7b81-4405-9f55-fd07ec349c2e-e13762d2","queryResult":{"queryText":"whats the price today?","parameters":{"metal":"the"},"allRequiredParamsPresent":true,"outputContexts":[{"name":"projects/nscustomercare-kcohnw/agent/sessions/88777853-4d56-9b07-a561-3a58be7b0ab5/contexts/__system_counters__","parameters":{"no-input":0,"no-match":0,"metal":"the","metal.original":"the"}}],"intent":{"name":"projects/nscustomercare-kcohnw/agent/intents/ca51bfd5-194a-4594-9f04-c392c0a9692c","displayName":"PriceEnquiry"},"intentDetectionConfidence":0.75200003,"languageCode":"en"},"originalDetectIntentRequest":{"payload":{}},"session":"projects/nscustomercare-kcohnw/agent/sessions/88777853-4d56-9b07-a561-3a58be7b0ab5"}
I guess there are other services where you can convert spreadsheet into API without sharing it with everyone. You might have to use one of those service.
Thank you. I'm new to Dialogflow and coding in general and have tried copying your tutorial. I've got to the very end all okay but the look ups on your line 26 are not working correctly in my Inline Editor (the whole line from 'Here are the details...to the semi colon at the end is all in orange font which doesn't look right). I'm able to Deploy the code successfully but when I try entering a name I receive the following back - Here are the details for ${name}. Age: ${person.Age}. Email: ${person.Email}. Phone: $(person.Phone}. Appreciate if you can assist me please. My coding is as follows: function welcome(agent) { const name = agent.parameters.name; return getSpreadsheetData().then(res => { res.data.map(person => { if(person.Name === name) agent.add('Here are the details for ${name}. Age: ${person.Age}. Email: ${person.Email}. Phone: $(person.Phone}');
you need to use backticks ie. ` instead of single quote ie. ' backticks are generally on the same key as ~ (tilde) key so it should be agent.add(`some text ${some_parameter}`);
It does not work! And a warning - if you are going to have more than 500 entries per month, You will be charged 20$-99$. Error: No handler for requested intent at WebhookClient.handleRequest
Thank you so much! Great presentation. Easy to follow instructions. Please make a lesson also on how to use Dialogflow to store data in the google spreadsheet.
Here you go: ua-cam.com/video/huwUpJZsTok/v-deo.html
you explain and your tutorials are the best to understand please bring some more tutorials like that graph database or ontology
Thank you greatly, your videos have been resourceful.
I used to do this using Lambda functions. This is easier than that. Thanks.
I am waiting for your tutorial of Dialogflow with MySQL and NoSQL DB
Thanks Rohit, you can watch my other tutorials on Integration of Dialogflow with Firebase and DynamoDB.
How do you do that?
@Rohit Can you please share the process?
Great Video, I will recommend all your videos in our social network
Great! Thank you so much 👍
Thank you for the tutorial! On question, at 3:33 how did you make the page so easy to read? For me it is in dense text form.
Hi i need help with this as well. My api reflects the header as string. May i know how to change to header?
You need to install a Chrome extension called Json viewer... Just. Search for Json viewer Chrome and then add it to Chrome.
@@AxleWebTechnologies hi so how do i make the name, age, phone and email become a header? Mine shows as a string and I am unable to call it in dialogflow
thank you for sharing this. Can you share where can I put the else statement so that if the name does not exist, chatbot will return a not exist message.
Thank you!
Great ??? can we use AirTable ???? becz. its a based on API
You're the man!
When I go to deploy I get the error Error happened during Cloud Functions Deployment and there is a message at the top
Newly created cloud functions now use Node.js 10 as runtime engine. Check migration guide for more details.
Do you have instructions on how to fix this?
Thank you for the video...I have One question i.e. if I want to continue the names one after one without giving "Hi" after 1st result. How can I do that?
You can add multiple agent.add()
Thank you so much. I am trying the Google spreadsheet read/write myself with Dialogflow in the exactly same way as you showed in the video. I am encountering a problem when I have multiple entries with the same name in the spreadsheet, and the fulfillment fails to read the multiple entries. A few days ago, the same code worked fine and it listed all the entries with the same name, but now it fails. Could you help me with this problem?
I want to do the same any solution to that
Thank you! One question, is possible to make a search with wildcards like in sql like %searchterm% ? Thanks!
For that please check SheetDB.io API documentation.
Fantastic job! Thank you very much!
I keep getting the Firebase error: "Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail"
Is it just me? How did you all solved that?
Kind regards,
Actually it is just a warning and you can ignore it
Hi , I am bit new to this, really appreciate your help. I activated the billing as you mentioned , Also please note, I cannot see any firebase mentioned here. Instead of firebase it is "View execution logs in the Google Cloud Console" . I logged into Google cloud console and I found an error log like this. "textPayload: "Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail" " - Please advise what to be done ?
Hi Mathew, Yes they recently changed it from firebase to Google cloud logs.
Please try visiting console.firebase.google.com/project/
And then go to functions and then logs
@@AxleWebTechnologiesHey, I got the same error in the logs what you mentioned :/(dialogflowFirebaseFulfillment
Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail)
May i ask you, how can we solve the problem via code?
Best wishes.
Thank You so much
Hi friend, congratulations on the tutorial, it helped me a lot. I have a problem and would like your help. I need to create a condition when the value is not found in the database, I did the test with If and they however both return me ten times the answer to the limit of the database, example if the database has 100 rows he return the answer to me 100 times. Could you help with that?
You can write javascript code like filters, loops, conditions etc. Please refer to javascript tutorials for that.
www.w3schools.com/js/js_loop_for.asp
@@AxleWebTechnologies
Hi thanks! but my problem is that the If condition is returning the answer I need. But that answer comes back a dozen times. I would like the query to the database to return negative it only returns the default text (only 1 time) that the value was not found. Today he is returning the information that the value was not found only that this information returns ten times.
Hello, have you used to migrate this API using webhook?
I use the glitch platform to make external calls.
and you could use it to use that API. Then you wouldn't have to make a payment to use SheetDB.
I'm trying to apply, but it changes some things in the Inline Editor, and that's why I'm not getting it.
Thanks!
Sorry your question is not clear. Please tell me the exact issue or error you are seeing
Hi. I'm new to node.js and javascript in general. How should I retrieve multiple "persons", for example, from a list of students, return names of all males
You can use map and filter functions in javascript. Please refer to some javascript ES6 tutorials on youtube.
Thank you for this tutorial, it is very useful!
I have one questions. Once I want to deply the inline code I get the following error: Error happened during Cloud Functions Deployment. Do you know how to solve this problem?
Hello Sami, make sure you have admin permissions to the Dialogflow agent.
Go here and enable.. that's what helped me console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview
@@ankurjha9208 Not able to solve this. Please help
Same problem. Please help
You can try deleting cloud function at console.cloud.google.com and redeploy the code. Remember your old code will be lost so make sure you have a backup
You created a billing account. I hope that is free of cost whenever you run the chatbot?
Yes it is free to limited usage.
I found the cause of the problem. It looks now that you cannot make the agent.add call more than once in a function run next to each other. And that seems to be how Dialogflow is now works now, and that is completely a new thing that we have to live with, maybe. Anyone knows about this sudden change of policy, and why? It is very inconvenient anyway, not being able to call agent.add twice in a row.
Hey, do you know what entity needs to be used if your value is a mixture of numbers and letters for example S0010? The logs show I have the data but my system is not showing output. Thanks!
You can create a custom entity or a composite entity for this.
Hi AxleWeb team. I have followed your way and have wriiten identical code to read through google spreadsheets. However, I am getting below error:
Error: No responses defined for platform: DIALOGFLOW_CONSOLE
at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13)
at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38)
at process._tickCallback (internal/process/next_tick.js:68:7)
Any help will be really appreciated. Thanks in advance
error "Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail"
Hi, Thanks for the Video. Great Presentation and explanation.
I want to know how we can reply users with Video / ppt / HTML along with text?
Is it possible using Dialog Flow?
Thanks. Glad you like our videos. On which platform/channel would you like to launch your chatbot? Website/Facebook messenger/ WhatsApp or any other?
I want to launch on Website and My Android App.
@@bytechocr5878 For Website or Android App, you need to use Dialogflow APIs. We have built a custom user interface using HTML/React which can be embedded on websites. The custom Web UI interacts with Dialogflow using Dialogflow APIs. Please watch our video on how to integrate Dialogflow with Websites.
Thanks! @@AxleWebTechnologies I will check from your list of videos. I have sent an email to you from your website, let me know if got a chance to reply that. My email id is naveen.jain@bytechindia.com
Great video, extremely helpful! I got everything working fine, but I'm wondering if you had sample code that can be added that will ask for and return only the attribute you want. For example, I just want to ask for the Email for a specific person, but the next time it'll be the phone number.
Did you get a solution?
What if you have multiple tabs? How can you get sheetDB to create the API for a specific tab in your excel document
Please refer to sheetdb.io documentation for that. They have APIs to handle this.
Thank you so much for this video, I found it incredibly helpful. I am just having an error when a user puts in a name that is not in the database. The console won't reply. How can I get it to send back an error message to the user?
Thanks Matthew for your appreciation. Glad you found the video helpful.
For your scenario, you can write an if else logic... If user is found in database reply with message 1 else reply with message 2. Hope this makes sense.
Did you get it to respond with else?
I add "else" to the function and I don't get any response, not even to the "if".
hi , axleweb technology thanx for tutorial i have same code for fill the fulfilment bust some error waserror happened during cloud functions deployment fulfilment not deploy..so please some help me how to solve this
Hi, will you guide me as I am facing a problem while deploying? I guess it is not accessing data from a Spreadsheet.
Hi, Please join our slack channel, link is in the description, in there I or someone from our team will help you. ~Anshul
Hey, would You mind answering me a question ? :)
Instead of creating google sheets API with sheetdb.io I've created API with python.
Is there a way to connect it with Dialogflow?
From VScode I can read and write data to my sample sheet and it's working :) but how to integrate it with dialogflow ? 🙈
You need to host the api somewhere on the internet so that it is accessible by Google Dialogflow
@@AxleWebTechnologies Thank You! Appreciate that! :)
Is all the features shown in the video free? Will I need to make a paid subscription on Google cloud?
Yes the features are free.... However you need to enable billing account which means you need to card details... Google won't charge you unless you cross the free usage limits... The free tier limit is quite High... You mostly won't exceed it unless you have thousands of daily active users
@@AxleWebTechnologies Teaches you how to do this via the webhook. If you have this feature available
Could you share the index.js used in the tutorial? Sergo Kuruliszwili
Here you go: drive.google.com/open?id=1vmIGXSPTX7siA0HaZXaaBLPJazExe0fm
Thanks a lot for the video. I tried it, but it didn't work. Followed all the steps on the codes, and the DIAGNOSTIC INFO said that the webhook was executed successfully, but still didn't get the right response. From the fulfilment section, I can only access to the logs on Google Cloud, not Firebase, and it's difficult to navigate this platform and couldn't find the logs from the Dialogflow project. :( (It seems Google has made some strong changes recently). What should I do to make it work? Thanks!
Make sure you have enabled fulfillment in the intent. For firebase logs go to console.firebase.google.com/project/YOUR-PROJECT-ID
Then go to functions -> logs
@@AxleWebTechnologies Many thanks for your quick response! I checked the Intent section - the fulfillment was enabled, but I noticed that the value section for the name parameter appeared empty. So added the value $name, then re-wrote the code from your video on the fulfillment section, and the information started to appear correctly on the log on Firebase! But then when I tested with the test name value (Test1) on the google sheet, it didn't work. Then I changed the names on the spreadsheet to regular name text, it worked! I also noticed that the texts for the names are case-sensitive! Quite interesting details about this name issue. Thanks!!!
I want to extract multiples rows corresponding to same value. How to do do that?
You have to loop through the response and write agent.add for each response in the loop.
Sir is it possible to make a folder by giving command to the Chatbot?
Sorry your question is not clear? Where do you want to make a folder? Chatbot runs on a server so yes in theory it is possible to make a folder in server OS however, it is not possible to make a folder on client OS from chatbot
Hey there, I keep getting this error. dialogflowFirebaseFulfillment
TypeError: res.data.map is not a function
at getSpreadSheet.then.res (/workspace/index.js:26:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
Can you help out as to why this is happening?
Looks like you are missing parentheses () which calling a function.
Please check
I am doing a different implementation and need to ask a question: How can I get him to search for more than one term in the "name" field? For example: If I put "John, Paul" he will find neither John nor Paul in the search.
is it possible to do that?
Please use Regular expressions for complex searches. stackoverflow.com/questions/1177081/multiple-words-in-any-order-using-regex
Thanks for your tutorial. Could you please share the code used in this tutorial as you did in other videos? Thanks a lot
You can check out the code here: gist.github.com/Anshul0305/0af703a063f51ca00213add2634cd88b
hi, is there also a way to do the opposite: to input data into the spreadsheet via dialogflow?
Yes, please watch part 2 of this video tutorial.
I have executed the code and is without errors. But at end , the response body is not generated from API . Basically, I am not getting the desired output after 12:00 in the video . Please help with the issue.
Make sure you have written console.log() statement in your code.
I copied the code word to word and it keeps spiting out "not available" under the "default response" section, if you could help that would be great . Thank you.
It seems your fulfillment is failing or not working for some reason. Please check a few things
- Make sure Enable fulfillment option is enabled in your intent
- Make sure your billing account is enabled so that your Dialogflow agent can access external APIs
- Make sure there are no errors in Firebase console logs.
Don't free accounts work with spreadsheet integration?
Does this fetch method still work?
You can try using Unirest or Axios.
in google cloud console logs..i can see that Finished with status crash..any idea
Seems something wrong in your code. Please check your code for any syntax error or add console.log in your code to see where is it failing.
any references to learn dialogflow ? for further learning
You can watch my videos on basics of Dialogflow here ua-cam.com/video/Yjji510scI0/v-deo.html
advanced dialogflow
It works. Thanks :). but how to add a new line (
) in output? "
" doesn't work.
It depends on which platform are you using? is it Dialogflow web integration? or Facebook messenger or any other platform?
@@AxleWebTechnologies I tried it on dialogflow web integration. I will try on messenger as well. thanks for all your videos. it helps a lot ❤
@@rma1563 Dialogflow web integration doesn't work very well. Please watch my video on how to integrate Dialogflow chatbot with websites.
For messenger, you can do SHIFT + ENTER for the new line.
@@AxleWebTechnologies What to use for whatsapp for new line?
Google billing account is mandatory to use these cloud functions??
Yes, if you want to use Dialogflow inline editor then billing account is mandatory
Can work without billing acnt?
If you create and use your own webhook instead of using Dialogflow inline editor then you don't need a billing account
@@AxleWebTechnologies thanks boss
Without using payBill card is there any other way to interpret Spreadsheets ???
You can write your own custom webhook integration. With that you don't need to enter your card details. However, the process is slightly complicated. You can watch our video on how to create webhook in PHP for Dialogflow.
How to process if we have same name which repeats twice or more?
Excelent tutorial , i have one question, how i can do a POST on my table?
Currently sheetdb.io does not allow you to POST data to spreadsheet. You can use another tool called sheet.best. It allows you to GET and POST data from spreadsheet. I will create a tutorial on writing data into spreadsheet soon.
@@AxleWebTechnologies Thanks a lot, your tutorial are welcome ever
@@AxleWebTechnologies Hi can you please post a tutorial on this ASAP?
@@suchirumesh9660 Sure, this tutorial will be released by Sunday 8th Sept. Please subscribe to the channel and press the bell icon to stay updated.
@@suchirumesh9660 Here is the tutorial ua-cam.com/video/huwUpJZsTok/v-deo.html
Hello Anshul, much appreciate your tutorial! It is perfectly working on a newbie! This fulfillment is successfully deployed on a new agent. However it shows "Error happened during Cloud Functions Deployment" when I worked on the original one. The agent has been integrate with twillio. Thank you.
If your agent is very old, probably that could be the reason. Try updating npm package version on package.json file in inline editor
@@AxleWebTechnologies Thank you very much. May I know if update referring to the dependencies?
@@jasolutions1145 when you go to inline editor, you will find package.json. In that each package will have a version number. Make sure old package.json has same version numbers as that in package.json of new agents.
@@AxleWebTechnologies Many thanks! Yes I did that... updated to the latest version but it still not working :/
Great Video. I can not make this work. This is the error message I'm getting: "message": "Webhook call failed. Error: DEADLINE_EXCEEDED." Any Idea what I'm may make wrong. I've created the same sheet and made it all with a new testagent from scratch exaclty as shown in the Video. The logs also do not receive the Spreadsheet data :-(
Make sure you have enabled the fulfillment option in the intent and also make sure your billing account is configured. If you still see the issue, please share the code so that we can understand what's going on there.
@@AxleWebTechnologies sure thx here we go:
'use strict';
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const axios = require('axios');
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 GetGSheetData() {
return axios.get('sheetdb.io/api/v1/kzau8dj7mqfjg');
}
function welcome(agent) {
const name = agent.parameters.name;
return GetGSheetData().then(res => {
res.data.map(person => {
if(person.Name === name)
agent.add(`Here are the details for ${name}, Gender ${person.gender}, Email ${person.email}`);
});
});
}
function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try again?`);
}
// Run the proper function handler based on the matched Dialogflow intent name
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
intentMap.set('Default Fallback Intent', fallback);
agent.handleRequest(intentMap);
});
Try writing person.Gender and person.Email instead of person.gender and person.email
Thats because your spreadsheet has column Gender and Email with capital G and E respectively.
@@AxleWebTechnologies Thanks I had the same error code and this worked for me, you're awesome!
What will happen if there are 2 strings with the same name? Is it somehow possible to do a random function to show 1 of 2, but not both?
in that case probably you should something unique such as email id or serial number.
@@AxleWebTechnologies Is it possible somehow to show ONE random string if there are 2 with the same name.
Yes that is possible. You can handle that in your programming logic
Hello Sir thank you very much for this video,
Can you make a video on how to make dialogflow chatbot initiate conversation before user types any message, would really appreciate your assistance
You can watch our video on how to integrate Dialogflow with Websites. In that we have shown how to create a chatbot which initiates conversation without user typing anything.
@@AxleWebTechnologies Thank you for sharing that video sir, but in that video you have not mentioned how do we trigger that message ?
The chatbot shown in the video will automatically show a greeting message when launched. You dont need to do anything. What happens is basically When the bot launches, it sends "hi" message behind the scenes. You dont see this hi message in the chatbot ui. Whatever response comes from Dialogflow, the bot shows that response.
@@AxleWebTechnologies Totally agree with you Sir, but I want to know how did u implement it, because in the official document I could not find any way to trigger welcome message at start of conversation
It is just a matter of calling Dialogflow V2 API and getting response. We will create a video tutorial on how to make calls to Dialogflow V2 APIs sometime in future
I cannot seem to display any details retrieved from the spreadsheet like at 16:08 of the video.
But i have done everything correctly and it even deployed successfully. I'm stuck and i really don't know what to do. Please help.
this is the error on the logs:
dialogflowFirebaseFulfillment
Error: No responses defined for platform: DIALOGFLOW_CONSOLE at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13) at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38) at process._tickCallback (internal/process/next_tick.js:68:7)
This seems to be a problem recently introduced by Dialogflow. Many people are complaining about this and I have never seen this before.
Can you please try this: if you have multiple agent.add() in your code, just keep one and delete others and see if it works.
@@AxleWebTechnologies thank you so much, let me try it out
@@AxleWebTechnologies unfortunately it didn't work
Hi, we need to make an email and whatsapp chatbot, can you do it for us?
Sure we can help you with that, please drop an email to anshul.shrivastava@axlewebtech.com
please make a video for how data stores automatic from dialogflow chatbot to google spreadsheet.i need it.thank you in advance
Hi Pooja, this video itself is about storing data from Dialogflow to Google spreadsheet. Please let me know what specifically are you looking about?
~anshul
@@AxleWebTechnologiesThank you for your reply.I watched lot of videos however i am not able to find out my solution.You taught really well.I need to add phone number to google calendar from dialogflow automatic from cal logs.Don't know what to do...:(
Hey.
When entering into (package.json) "axios": "0.19.0" - writes - "Expected "}" and instead saw "Axios', "Expected "}" and instead saw ':' and "Expected "}" and instead saw "0.19.0',
What needs to be done I do not quite understand.
- make sure you add a comma at the end of previous line.
- make sure the curly bracket } is there after "axios": "0.19.0"
@@AxleWebTechnologies Thank!
Question: can I make authorization by phone? For example, the bot sends the client a code via SMS, which it generates, the client enters the code number and the guest can work with the bot.
@@u.v8383 yes you can do that. You need to handle all that in your fulfillment code. You can call an API to generate OTP and then ask the user to input OTP. and then collect the OTP using a parameter. Then you can compare the API generate OTP and user-entered OTP.
@@AxleWebTechnologies Спасибо! скажите возьметесь за разработку небольшого бота, или можете помочь а написании? Если да, укажите пожалуйста почту, я вам скину техническое задание, и сразу обговорим финансы.
Hi, while deploying i m facing an issue my api response is webhook call failed and in the logs its showing as cannot read property of the column that i mentioned in the sheet.please help me to resolve this.
Please share the code and the firebase console logs.
Please note: we have created a Slack channel for all your queries. Please join the slack channel using below link and post your queries in the channel:
join.slack.com/t/dialogflow-awt/shared_invite/enQtOTUwMzAwOTI3Mjk2LWRiOGYwOGIyOGU4ZjNkNWI3NTJiMTgyMmMyNTM2OWE2YzZmZjkwNmEyMWZmOWIyZTRmNzY3MTY2ZDYzNWVhYzQ
@@AxleWebTechnologies this is my function block
function hoteldetails(agent) {
const PhoneNumber = agent.parameter.PhoneNo;
return getSpreadsheetData().then(res=> {
res.data.map(person=> {
if(person.PhoneNumber === PhoneNumber)
agent.add(`Here are the booking details of ${PhoneNumber}.Name : ${person.name}, RoomNo: ${person.RoomNo} , HotelName: ${person.HotelName} , HotelContactNo: ${person.HotelContactNo}`);
});
});
}
Cloud Logs:
2020-07-02T13:28:32.944Z dialogflowFirebaseFulfillment c1uor5kdz4sc TypeError: Cannot read property 'PhoneNo' of undefined
at hoteldetails (/srv/index.js:22:41)
at WebhookClient.handleRequest (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:303:44)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/srv/index.js:71:9)
at cloudFunction (/srv/node_modules/firebase-functions/lib/providers/https.js:57:9)
at /worker/worker.js:783:7
at /worker/worker.js:766:11
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9) E dialogflowFirebaseFulfillment c1uor5kdz4sc
undefined
2020-07-02T13:28:32.958831578Z dialogflowFirebaseFulfillment c1uor5kdz4sc Function execution took 2386 ms, finished with status: 'crash' D dialogflowFirebaseFulfillment c1uor5kdz4sc
It should be agent.parameters not agent.parameter
@@AxleWebTechnologies Thank you so much.but instead of getting the info of that particular person.i am getting everyones details in my response window
@@renistellalincy4309 This is JS programming issue, you can fix it by correctly programming the bot.
Hi, I'm a suscriber, you helped me a lot my friend, now I'm having an error when I try to do more than one question to the bot without saying welcome, hi, etc
Hello Subscriber, glad our videos helped you. Can you please clarify what do you mean by try to do more than one question? Also please provide some details about error you are seeing.
@@AxleWebTechnologies Hi! sorry if i was not clear, i connected the bot with a perfume data base. when i say hi to the chat bot, it let me search any perfume´s name and it return me the price. but if i want to search another, i have to say hello (or other traninig phrase) again. i would like to know how to consult without a training phrase. thanks!
@@valentinpouso2043 ok so the best thing you can do is after showing pricing for a perfume, ask a question, "would you like to search for another perfume?" if user says yes, then trigger the perfume search intent, if the user says no, then close the conversation. You need to use context and follow up intent for that. Please watch this video series for more details ua-cam.com/video/Yjji510scI0/v-deo.html
Quanto valor para utilizar?
sorry your question is not clear.
a mi me sale este tipo de error alguien sabe por que: Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500.
Hii.. I need a watsapp chat bot.. Can u build it according to my need??
Sure. Please send your requirements at anshul.shrivastava@axlewebtech.com, we will help you with all your chatbot requirements.
My Save button is not getting enabled, can you help?
Make sure the service account is created and you have owner permission to the agent. You can try creating another agent in Dialogflow and see if that works.
I get data to my Firebase that is broken out correctly. It shows all the data in my google sheet. It still will not give me a response for characteristics from the sheet though!!!! Grrrr!!!
Make sure to use back ticks ie. ` and not single quote ie. ' while writing output message.
Basically write `${YOUR_VARIABLE}`
and not '${YOUR_VARIABLE}'
Hello! can you help me? My log does not appear in firebase!
Make sure you are checking the correct project in firebase. Try writing console.log() in your fulfillment code and then check the logs.
@@AxleWebTechnologies Many thanks for the reply! Congratulations on the content! Your videos and the way you explain the walkthrough are perfect!
when I enable inline editor , it shows Billing Required
Yes you have to enable billing. Please watch my other video on how to connect Dialogflow with external APIs
When i try to execute "console.log(res.data); " my log is not showing any response of the data . What would be the error here
Make sure you have enabled fulfillment option in your intent.
@@AxleWebTechnologies Yes i have enabled "Enable webhook for this intent " option . But still i am facing this issue.
@@jjoshua95 is billing account configured for the project?
Axle Web Technologies yes it is configured .can I give access so that you can look I have setup everything correctly .
@@jjoshua95 sure, please share your agent with anshul.shrivastava@axlewebtech.com
works with whatsapp?
Not directly. You need to use Twillio to integrate with whatsapp.
Great tutorial. Can u guide for more information to pull out results through rows of data under a column header, for example:
1. Three columns: City | Date | population
2. Rows contain, population of cities for different dates,
3. Question asked:
Q 1. What is the total population of city 1, it collects the data from the many rows and applies the add function to give an output,
Q2. What is the average population of the city 1 for the first quarter of 2019 ?
It averages and provides the result,
Q3. Which city leads the Rate increase in Population:
It compares and shows the trend result.
Would be grateful if could guide for above example or similar.
Thanks
Mohit
The code works fine for the name with a single entry, however.
I cant seem to get the code right.
Where exactly are you facing the issue?
This is great content, and I thank you for it.
I have encountered an error when deploying:
"Error happened during Cloud Functions Deployment
"
Under package.json I see the error at line 21:
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "8"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.5.0"
"axios": "0.19.0"
}
}
Error log as follows >> (Expected '}' and instead saw 'axios'. Expected '}' and instead saw ':'. Unrecoverable syntax error. 91% scanned.
How can I fix this?
You have to add a comma (,) just before "axios" and after "dialogflow-fulfillment": "^0.5.0"
so it should be :
"dialogflow-fulfillment": "^0.5.0",
"axios": "0.19.0"
Axle Web Technologies Thank you for your reply. I'll try this now.
"axios": "0.19.2" is making issue.
Error Message:
The deployment of your Cloud Function failed:
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`gen_package_lock` had stderr output:
npm ERR! file /workspace/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 667 while parsing '{
npm ERR! JSON.parse \"name\": \"dialogflowFirebaseFulfillme'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /builder/home/.npm/_logs/2020-03-17T06_56_33_997Z-debug.log
error: `gen_package_lock` returned code: 1", "errorType": "InternalError", "errorId": "5E1A5043"}}
Please help as due to this error I'm not able to deploy.
Looks like something is wrong with your package.json file. Try creating a brand new agent in Dialogflow and use that to create your chatbot.
Hey great video!!
After adding the initial code and functions, I get this error when i try to deploy the code:
Error happened during Cloud Functions Deployment.
My billing account is activated (I have used other features like sending media, etc) cause i have used other features as well and they work fine. My previous code was working fine before I added the axios dependency and added the sheet.io feature!
Please help me out!
function getSpreadsheet(){
return axios.get('sheetdb.io/api/v1/283rh8ewnpbo2');
}
function getPrice(){
return getSpreadsheet().then(res => {
console.log(res);
});
}
.
.
intentMap.set('PriceEnquiry', getPrice);
This is the error on my firebase console:
dialogflowFirebaseFulfillment
Dialogflow Request headers: {"host":"us-central1-nscustomercare-kcohnw.cloudfunctions.net","user-agent":"Google-Dialogflow","transfer-encoding":"chunked","accept":"*/*","accept-encoding":"gzip,deflate,br","content-type":"application/json","forwarded":"for=\"66.249.83.54\";proto=https","function-execution-id":"dau4x8v91pb3","x-appengine-country":"ZZ","x-appengine-default-version-hostname":"y7530e94f078d7f1cp-tp.appspot.com","x-appengine-https":"on","x-appengine-request-log-id":"5ef5cb2200ff00fff9f82688b0370001737e7937353330653934663037386437663163702d7470000139303866373866633530636138623435363966303164656633393333393136383a33000100","x-appengine-timeout-ms":"599998","x-appengine-user-ip":"66.249.83.54","x-cloud-trace-context":"54e5caafbb06b337baa57ab8ce47d16c/1191335711639240445;o=1","x-forwarded-for":"66.249.83.54","x-forwarded-proto":"https","connection":"close"}
3:47:13.747 PM
dialogflowFirebaseFulfillment
Dialogflow Request body: {"responseId":"b7a9d2b7-7b81-4405-9f55-fd07ec349c2e-e13762d2","queryResult":{"queryText":"whats the price today?","parameters":{"metal":"the"},"allRequiredParamsPresent":true,"outputContexts":[{"name":"projects/nscustomercare-kcohnw/agent/sessions/88777853-4d56-9b07-a561-3a58be7b0ab5/contexts/__system_counters__","parameters":{"no-input":0,"no-match":0,"metal":"the","metal.original":"the"}}],"intent":{"name":"projects/nscustomercare-kcohnw/agent/intents/ca51bfd5-194a-4594-9f04-c392c0a9692c","displayName":"PriceEnquiry"},"intentDetectionConfidence":0.75200003,"languageCode":"en"},"originalDetectIntentRequest":{"payload":{}},"session":"projects/nscustomercare-kcohnw/agent/sessions/88777853-4d56-9b07-a561-3a58be7b0ab5"}
3:02 Isn't it dangerous to let anyone see the sheet? This is company data
I guess there are other services where you can convert spreadsheet into API without sharing it with everyone. You might have to use one of those service.
Thank you. I'm new to Dialogflow and coding in general and have tried copying your tutorial. I've got to the very end all okay but the look ups on your line 26 are not working correctly in my Inline Editor (the whole line from 'Here are the details...to the semi colon at the end is all in orange font which doesn't look right). I'm able to Deploy the code successfully but when I try entering a name I receive the following back - Here are the details for ${name}. Age: ${person.Age}. Email: ${person.Email}. Phone: $(person.Phone}. Appreciate if you can assist me please. My coding is as follows:
function welcome(agent) {
const name = agent.parameters.name;
return getSpreadsheetData().then(res => {
res.data.map(person => {
if(person.Name === name)
agent.add('Here are the details for ${name}. Age: ${person.Age}. Email: ${person.Email}. Phone: $(person.Phone}');
});
});
}
you need to use backticks ie. ` instead of single quote ie. '
backticks are generally on the same key as ~ (tilde) key
so it should be
agent.add(`some text ${some_parameter}`);
Axle Web Technologies Thank you very much, all working now.
Can´t be useful if you don´t pay?
you will be asked to add your card but you won't be charged until you cross the free usage limit which is quite high.
@@AxleWebTechnologies Do you know what the free usage limit is?
@@PumaClaws Please see this
dialogflow.com/pricing
cloud.google.com/dialogflow/quotas
It does not work! And a warning - if you are going to have more than 500 entries per month, You will be charged 20$-99$.
Error: No handler for requested intent at WebhookClient.handleRequest
Looks like something wrong in your webhook. can you please share the fulfillment code?
Alguém sabe como insiro o comando "else" neste código
if(intentName == 'NOME INTENCAO'){
var Pedido = request.body.queryResult.parameters['Pedido'];
return axios.get("LINK").then(res => {
res.data.map(person => {
if (person.Pedido === Pedido)
response.json({"fulfillmentText" :"Detalhes
para o pedido "+Pedido+":"+"
"+
"Nome: "+person.Nome+"
"+
"Status: "+person.Status});
});
});
}
Você conseguiu responder com "else"?
Crack bro
another way to connect dialogflow with yet another paid webapp....woah....just woah...
Hello, how can I do the reserve? I mean when user type his/her info, how can we get that to sheets?
Please watch the video tutorial part 1 and part 2 for that. Let me know if you face any specific issue.