Cognitive Computing on - Part 2

A couple of months ago I started working on integrating IBM Watson with Salesforce. My original post described the overall design, in this follow up I discuss how to install and use the lightning component.


Getting Started

This section highlights all the necessary config required in your Dev Org to get and running with the component.

Deploy the components to a Dev org. Head over to the GitHub Repo and deploy using the Deploy to Salesforce button.

Update Custom Settings

IBM Watson Service Credentials

Setup a IBM Watson Developer Account and create a Personality Insights Service

IBM Watson Developer Cloud Credentials

Grab the credentials and store in the IBM_Watson_PersonalityInsights Custom Setting. The URL for the service is actually The API docs can be found here

IBM Watson Personality Insights Custom Setting

Twitter API

Create a App on and grab the key and access token
Twitter API

Store the credentials in Twitter_API Custom Setting

Twitter API Custom Setting

Enable My Domain

Find the option in Setup and select a domain, make sure its enabled before progressing to the next step.

My Domain

Add Component to Contact Page

The Personality Insights Component should be placed on the Contact Record Home page. In order to do this you need to enable App Builder for Lightning Pages if you haven't done so already.

Lighting App Builder Setting

Once you have done this, navigate to a Contact Record Detail page and click Edit Page option from the setup menu.

Remote Site Settings

API callouts to the Twitter API and IBM Watson need to be setup as remote sites. See below for what this should look like.

Remote Site - IBM Watson

Remote Site - Twitter API

GitHub Repo



Next Steps

  • View Users with a similar personality profile as the Contact
  • Work for both Lead and Contact or other Custom Object
  • Test classes
  • Better error handling
  • Happy to discuss other ideas :-)
Show Comments

Get the latest posts delivered right to your inbox.