Salesforce integration
SmartBot360 makes it easy to have bots create Salesforce tickets (Service) or leads (Marketing). Here are the steps.
Step 1
Login to your Salesforce account. From Setup, enter Apps in the Quick Find box, select App Manager, then click New Connected App on the top right.
Step 2
Enter the required information for your new connected app. Under API (Enable OAuth Settings) , click Enable OAuth Settings checkbox.
Under Callback URL, enter https://{url}#/dashboard/salesforce where url is your current dashboard url. If your dashboard url is smartbot360.com then the callback would be https://smartbot360.com/#/dashboard/salesforce.
Under Selected OAuth Scopes, Add the following OAuth Scopes:
Full access (full)
Perform requests on your behalf at any time (refresh_token, offline_access)”.
Step 3
Under App Manager find your newly connected app, click on the bottom facing arrow on the right side of your app. Click view and you will see your Consumer Key and Consumer Secret. Copy these somewhere as we will need to paste this in a later step.
Make sure your account has API access enabled. The following Salesforce editions have API access.
Step 4
Below App Manager you will see “Manage Connected Apps“. Visit the page and click the edit button next to the newly created app.
Under the OAuth Policies section, set the Permitted Users dropdown to “All users may self-authorize”. Then click save.
Step 5
Now go to your SmartBot360 Dashboard. Go to the SETTINGS page, and under Integrations select Salesforce. Set the Salesforce account information by pasting the information from the previous steps.
Step 6
Go to CHATBOTS to create a Flow Diagram bot. The bot should collect some information about the end user and then create the case or lead (IMPORTANT: name and email are necessary for Cases; name, email, and company are necessary for Leads). If you don’t want to use the company field, please refer to this article here. You can use the User Profile box to collect user profile information as shown below. (For example: user_fname, user_lname, user_phone, user_email, user_company).
Example for Cases:
Example for Leads:
Then, collect the user’s concern, again using the User Profile box as shown below, by creating a new user profile field named “user_concern”.
Then, add a Salesforce box and choose the Salesforce Object Type (Case/Lead) where you want to save the contact under.
Note that the four variables (user_email, user_fname, user_lname, user_phone) were collected in the first four boxes of the diagram. Only one of first or last name is needed, as they are concatenated into one name before submitting to Salesforce. When the bot execution reaches the Salesforce box, SmartBot360 will create a Salesforce case/lead for the user specified in the fields.
The conversation up to that box (or a secure link to the conversation) will be stored in the Description field of the lead or case.
Optional step (i) - Store Custom Salesforce Object Fields
To add custom fields in your chosen Salesforce Object (Lead or Case), click on the ‘+ Add Field’ button
Use the dropdown menu to select the custom field that you want to add to the Salesforce Object.
Type in the text input field with the value you want to set the custom field to be. You can also use a user variable as a value for a field. Examples shown below, where ‘user_reason"‘ is a user profile field, whereas ‘High’ is a constant (i.e. not a field)
Optional step (ii) - handle duplicate salesforce entries
Maintaining clean, accurate data is one of the most important things you can do to get the most out of Salesforce. The Salesforce box has a flow condition that will be taken if a duplicate Salesforce entry has been detected.
In the picture above, there are three routes the Salesforce box can take. If Salesforce detects a duplicate entry when the user reaches this box, the bot will take the flow with the ‘Contact already exists’ condition. It is recommended to set your duplicate/matching rules on your Salesforce account to make duplication checking much more in tuned with your preferences. For more information, please visit the Salesforce documentation about managing duplicate records here: Salesforce: Managing Duplicate Records
Limitation: If multiple boxes of this integration are present in a chatbot diagram, they all share the same fields, that is, editing one box updates the fields of the others.