Article Quick Links:
- Configure the Salesforce Integration
- Check Salesforce Case
- Create Salesforce Case
- Create Salesforce Lead
- How to Find Field Names in Salesforce
The Salesforce API block allows you to do the following actions in Salesforce, all through your bot:
- Check a Case: Recall specific case information and share with a live chatter
- Create a Case: Seamlessly populate case fields in Salesforce with conversation content
- Create a Lead: Build out detailed leads with information collected from a chat
Before you set up your Salesforce API Block, you will need to configure a Salesforce user with the appropriate credentials and add API permissions. To do so, please see this article.
Configure the Salesforce Integration
Before you can begin setting up a Salesforce Block, you must configure the Salesforce Integration in your Ada Settings.
To do so:
- Go to the Settings panel in your Ada dashboard
- Click Integrations, and scroll down to Action Integrations
- Click Configure next to Salesforce API
- Enter your Salesforce User credentials in the modal. For instructions on how to set up a Salesforce API user, see here.
- Click Save
Check Salesforce Case
This option helps you seamlessly look-up and provide information from a Salesforce case during an interaction with a chatter.
Action: Click on the drop-down titled Select Action, and choose Check Case.
Body Content: The Body content field helps you search your Salesforce instance. The parameter on the left is a field name in Salesforce, such as Email. The parameter on the right is the value that you are searching for, such as an email address. The block will return the first object found in your Salesforce instance that matches all of these fields.
We recommend including a field in your search that will ensure that chatters can’t retrieve information from other, non-related cases. For example, if you have an identifying field in your Salesforce instance such as CaseNumber, add it as the parameter name, and then include a variable containing the case number as the value. This would mean that only Case records would be returned that contain a CaseNumber field that matched that variable.
To learn how to find your Salesforce field names, click here.
Response: The Show Schema button will allow you to see the data returned and makes it easier to map results to variables. Please note, every time you click Show Schema, you’re creating a new Case in your Salesforce instance.
Error Answer: Under Error Answer, click Choose an Answer, and select a pre-created answer. If the case look-up fails, this will be surfaced.
Now, go back to the Response field, and click Show Schema. In the returns, you should see a variety of Variable options highlighted in blue with plus buttons next to them.
Save as Variable: Choose a Variable such as CaseNumber, and click on it to add it to the Variable field. Click the blue Save button to save.
Data Key: This field should mirror the variable you chose. For instance, if you selected Case Number, it should read: CaseNumber
Optional: In a text content block below the Salesforce block, you can optionally add a sentence such as “Great, your tracking number is” and insert the local CaseNumber variable here.
Remember to click the blue Save button when you’ve completed your Answer.
Create a Salesforce Case
To create a Salesforce case, drag the Salesforce block into your Answer and follow the below configuration set up.
Action: Click on the drop-down titled Select Action, and choose Create Case.
Body Content: Each entry in Body Content allows you to set fields on the case object in Salesforce. These field values can use variables and static text. In this example, a case will be created with email, name, along with additional custom fields.
Set the body content format to JSON. Next, click the green plus button. In the rows below that populate, set up your case fields with a Key and a corresponding Value.
For instructions on how to find Salesforce field names, see below.
Save as Variable: Case creation will allow you to save the ID of the newly created case as a variable, by putting the text ID in the Data Key and specifying the variable it will be saved in.
Create a Salesforce Lead
Action: Click on the drop down bar that reads Select Action, and choose Create Lead
Body Content: Each entry in the Body Content allows you to set fields on the Lead object in Salesforce. These field values can use variables and static text. If you need to know the field names to use in your Salesforce instance, talk to your Salesforce administrator
Response: This button will allow you to see the data that is returned, and makes it easier to map results to variables.
Error Answer: If the creation fails, the conversation will be redirected to this answer.
Save as Variable: Lead creation will allow you to save the ID of the newly created lead into a variable, by putting the text ID in the Data Key and specifying the variable it will be saved in.
How to Find Field Names in Salesforce
To find the field names in your Salesforce instance:
- Click on the gear icon in the upper right-hand corner of your Salesforce dashboard, and select Setup from the menu.
- In the Quick Find search field at the top of the left hand menu, search for object manager.
- Once in the Object Manager page, in the Quick Find search in the top right, search for and click on Lookup Rollup Summary.
- To find field names, select fields and relationships and search for the fields in question.
If you are interested in upgrading your bot to allow for this functionality, please reach out to your ACX Consultant, Account Manager, or email@example.com.
For any additional questions, contact your ACX Consultant, Account Manager, or email us at firstname.lastname@example.org.