I started a chatbot in Chatfuel which is connected with Myanmar First aid FB page. (m.me/myanmarfirstaid).

But it would probably be migrated to My opd page which is more relevant.

I’m going to explain how I created this chatbot

The services  I used.

  1. Chatfuel
  2. Integromat
  3. Google Custom Search
  4. Google Sheets.

  • Basically, Chatfuel serves as a front end to display information to users.
  • Google sheet is the database.
  • Integormat is the medium between chatfuel and Google sheet to transfer data.
  • Google custom search is a separate service which is useful when the information does not exist in the Google sheet. It uses the same user attribute (aka user’s input) and searches in the custom search engine. The Google CSE needs to be prepared by advanced. Not very difficult though, I’m gonna explain details in next session.

Chatfuel

It has blocks and cards. I used automate session to give the users the options.

The bot has different functions.

  1. Depression test (calculation, if statements and showing results)
  2. Blood pressure ( same as depression test, collect user input and show answers with if statements )
  3. Blood glucose ( same as Blood pressure, collect user inputs and show answers with if statements )
  4. Searching for the drug. if the users click on drug search. It will reach to “collect “ block. In which, I set up user attributes card, to store the input users typed in as a variable. Then I called the JSON plugin. So, another work is to go to integromat or other automation services to search data in Google sheet. See more details in Integromat. The search result would be shown inside integromat. So, I don’t specifically need to customize in Chatfuel.
  5. Dictionary. It’s similar to searching drug. But, I used different service ( flowxo). It’s more complicated than integromat. Besides, it stops functioning. So, I’m not gonna explain here.
  6. In order to use Google custom search, I set up a plugin called Google search. I could also use another search engine, such as Bing or swift type search. But, I haven’t tested them yet. After adding Google custom search, I need to add API key and custom search engine ID. There is a link to that services,  you have to follow the guidance and you will get an API key and CSE id. Then, chatfuel will do the next steps.

2. Integromat

Create an account. Then start creating a new scenario. Even though they use different terminology. It’s similar to projects. From the scenarios, you can set up a new workflow. Don’t need to worry too much, check this reference. Because I have to explain very long if want to deep into integromat.

Steps.

  1. Create a webhook, put the link in chatfuel’s JSON plugin as post method. Don’t forget to add user attributes under the address.
  2. Then, you might want to type something from chatbot( don’t forget to show the card you are actually working on, I mean drug search card). Webhook from integromat will recognize the input and start working.
  3. After that, link to google drive account, and select the google sheet you store data.
  4. Choose file, then choose workbook. You need to select which column you wanna find the data. That is the filter section working.
  5. Then, array aggregator comes in, which is to rearrange data from sheet to a new format. You can select which columns you wanna show in the results page. So, can rule out unnecessary columns.
  6. Then, the next step is routing. Which is useful when you want to create results for all possible outcomes. Such as, if there is no data, go to this place and do that. If there is data, show this and do that. Something like that.
  7. From the routing, you can create chatfuel cards, There are messages, user-attributes and redirect to blocks. From the message, you can create text, image, sound etc. To understand the data structure, you need to learn a bit in this link.
  8. If there is no data, I created an option 2 from routing and shows error text then redirect to a new chatfuel block ( which is google custom search). So that, users will be able to see results in google.

3.Google custom search

It is very easy to use. Search from the google custom search and it will give you a link to the website. You need a google account. You can put as many web address as you wish. In my case, I added Myanmar healthcare websites. So, the query will be searched only inside those websites. You can edit site ranking and other options.

https://cse.google.com/cse/all

You will get a search engine id and put it in the chatfuel plugin. Then its’ done.