1

I currently have a Watson chatbot set up and also have a DB2 database with some tables set up.

Could someone please assist me in how to develop a code in the IBM Cloud function to connect both the chatbot and DB2 services, as well as how the code in the Dialog nodes needs to be to either read or write to the tables in DB2?

1 Answer 1

1

This IBM Cloud solution tutorial shows how to build a Db2-driven chatbot with IBM Watson Assistant and IBM Cloud Functions for the app code. The related GitHub repository has working code for serverless actions that either insert a new record into Db2 on Cloud or retrieve data based on criteria entered within the chat.

The file eventFetchDate.js would search for a specific event record within a given date range. You can use any supported programming language. The most important part is to pack the result into the structure expected by Watson Assistant. The workspace file has the full set of dialog nodes and demonstrates how to interact with the user and Db2.

5
  • 1
    Would it be possible to perform this without slack? I already have my own web page with my chatbot embedded, so would prefer to stay away from slack
    – G31
    Feb 1, 2019 at 17:12
  • Yes, using Botkit as middleware and Slack as frontend is just how that solution was implemented. You could have any frontend and app layer. Feb 1, 2019 at 17:29
  • I followed the instructions for the tutorial you listed, however, within the Watson assistant, I am getting "node errors" each time a call to the Database is made?
    – G31
    Feb 2, 2019 at 14:07
  • The actions require credentials. They are passed in through Botkit. Did you do that or pass them in via other ways? Feb 2, 2019 at 16:23
  • I did it in the same way that was defined in the tutorial. I attempted it again, but still no luck?
    – G31
    Feb 2, 2019 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.