Salesforce: How to Integrate

  • Updated

Get Enterprise AI+

Do you want access to Knowledge Search in your Zingtree+Salesforce integration? Click here to request access. Or contact your Zingtree Account Manager or our Support Team. You will also need to update your Zingtree App in Salesforce and enable Knowledge Search. See installation instructions below.

Salesforce Integration Setup Video

Overview

Zingtree and Salesforce play well together. 

Using the Zingtree integration you can add scripts to your cases that will guide an agent to the proper solution, or through a company process.

 

The newly upgraded Salesforce app now allows you to also add Knowledge Search to deliver quick and relevant responses, searching across all of your Organization’s sources of Knowledge.

The most recent node and the buttons clicked during the session are saved with the ticket, so if another agent takes over the call, they can see the steps the caller took with the previous agent.

You can also use Zingtree for end-user data gathering or self-solving. Have your end-users try to solve their problem by showing them a Zingtree. If the customer is unable to find a solution,  they can submit a case to Salesforce, which automatically includes the Q&A transcript of their session with Zingtree. 

This article covers integrating Zingtree scripts and Knowledge Search to your Salesforce cases. For more on including Zingtree session data in your Salesforce forms read this article

Installing the App

The first step is to download and install the Zingtree App into Salesforce. Click here to download the Zingtree App for Salesforce from the Salesforce Marketplace. During the installation, you can choose to install in a Sandbox or Production environment. You must have Salesforce Admin permissions in order to complete the installation in either environment.

For the latest release including Knowledge Search download here:

 

Once you've installed, you will be taken to the following page in Salesforce. We recommend Install for All Users because it will save you the step of having to give permissions later. 

img_620e72c1dc724.png

Click on one of the Install for options, “I acknowledge…”, and then click on Install. You'll get the following pop-up:

img_608a11fa1fbc6.png

Check the box to grant access to the third-party website and click Continue.

The installation may take a few minutes to complete, but you'll receive an email from salesforce once it's finished. 

After successfully installing, you'll see the following:

img_608a122869b9b (1).png

Click on Done. You will be taken to the following page where you can see the Zingtree app.

img_608a125c02f6c.png

Apply Zingtree Package Permission Sets

Important: For using the App as someone who is not an Admin, you’ll need to set up Permission Sets for the App to work properly. If you chose "Install for All Users" previously then you can skip to ahead to Configuring the App

When you install the Zingtree package for Salesforce (SFDC), a number of new components are installed and prepared for you to use. Before you roll this out to your team, you’ll need to give access to the correct pieces of configuration. If you don’t, your users might have trouble actually interacting with the embedded trees.

Be sure to follow the following steps for applying the Permission Sets so that your users can access the various package components.

Permission Sets Included:

  • Zingtree Admin – For all Admins that will be configuring the Zingtree package/components. (E.g., SFDC System Administrators)
  • Zingtree User – For all Users of the Zingtree package (E.g., Support Reps, Salespeople, etc…)

How to Assign the Permission Sets

  1. Validate that you’re logged in as a Salesforce Administrator, or at least someone with Setup / Configure permissions in SFDC.
  2. Navigate to Setup > Home > Permission Sets:
    2022-07-01_10-43-14.png
  3. Find and click on the name of the appropriate Permission Set (Zingtree Admin or Zingtree User).

    2022-07-01_10-44-49.png

  4. Click on Manage Assignments.

    2022-07-01_11-00-19.png

  5. Click on Add Assignments.

     

    2022-07-01_11-02-26.png

  6. Add whichever users you’d like.

Note: The following permission sets are applied for each user. 


Zingtree Admin
:
  • App Visibility
    • Zingtree_Management App
  • Apex Class Access
    • ZingTreeAgentScriptController
    • ZingTreeAgentScriptController_Test
    • ZingTreeApiException
    • ZingTreeConfigLwcController
    • ZingTreeConfigLwcController_Test
    • ZingTreeConstants
    • ZingTreeFormFieldsResponse
    • ZingTreeFormFieldsResponse_Test
    • ZingTreeGenericException
    • ZingTreeHttpMock
    • ZingTreeTestDataFactory
    • ZingtreeConfigurationService
    • ZingtreeConfigurationService_Test
  • Custom Setting Accesses
    • ZingTree_Configuration_2__c
    • ZingTree_Configuration__c
    • ZingTree_Mapping__c
    • Zingtree_Logger_Configuration__c
  • Tab Access
    • Zingtree_Config
Zingtree User:
  • Apex Class Access
    • ZingTreeAgentScriptController
    • ZingTreeAgentScriptController_Test
    • ZingTreeApiException
    • ZingTreeConstants
    • ZingTreeFormFieldsResponse
    • ZingTreeFormFieldsResponse_Test
    • ZingTreeGenericException
    • ZingTreeHttpMock
    • ZingTreeTestDataFactory
    • ZingtreeConfigurationService
    • ZingtreeConfigurationService_Test
  • Custom Setting Accesses
    • ZingTree_Configuration_2__c
    • ZingTree_Configuration__c
    • ZingTree_Mapping__c
    • Zingtree_Logger_Configuration__c


Configuring the App

Zingtree needs just two parameters for launching a specific tree:

To start, you can set global parameters for all objects that launch Zingtree. After that, you can override these defaults from the object’s page layout, or even add a Tree ID field to your object to have different trees appear for each record.

Here’s how to set the global configuration:

  1. Choose the Zingtree App from the top left of Salesforce.

    2022-07-01_10-35-04.png

  2. Pick Zingtree Configuration from the top of the page.

  3. Enter your Zingtree API Key.  You can find your API Key from My Account > Organizations & Billing > API & Data.
  4. The hostname should always be https://zingtree.com unless you have a custom Zingtree server.
  5. Enter the default tree ID. This is the tree that will appear if you haven’t set a different tree ID at the object or record level. To find your tree ID open the tree and choose Information > Support from the top navigation. You'll find the tree ID here:
    mceclip2.png

     

  6. If you enable Knowledge Search, enter the Deployment ID of your configured Search Widget. You'll find this in Zingtree here:
  7. Make sure to click Submit when finished.


Add the App to a Layout Page

Once installed, you’ll need to add the App to one or more object layouts. These locations are currently supported:

Salesforce Locations Agent Script Component Knowledge Search Component
Home Pages ✔️ Coming Soon
Record Pages ✔️ ✔️
Wizard Flows ✔️ Coming Soon
  1. Go to Salesforce Setup.
  2. Click on Object Manager.
  3. Choose the type of Object to which you’d like to attach a decision tree.
  4. Click on Lightning Record Pages.

     

    2022-07-01_10-06-33.png

  5. Pick the Record Page to modify:

    2022-07-01_10-07-33.png

  6. Click Edit:

    2022-07-01_10-08-39.png

  7. Drag the desired component onto the layout wherever you would like it to appear. The following lightning web components are available for record pages. If you are updating the app and already have the Zingtree component installed in a page layout, remove it and add one of the updated Zingtree components. 
    • Zingtree Contains both Agent Script and Search tabs

    • Zingtree Agent Script  contains only the Agent Script tab.

    • Zingtree Knowledge Search Contains only the Searchtab. Coming Soon. Do not use this option.

  8. If you want to override the global default tree ID, click on the component to configure the new Tree ID to show.

  9. Select the Disable Pause and Resume checkbox only if you want the tree to always begin with the 'Start Node'. You will not be able to pause and resume your sessions, rather a new session will always be created. This overrides the default of allowing a tree on a record to resume where it last left off.
  10. Make sure to click Save when finished.

 

Mapping Data Fields

Important for app versions 4.6 or above you must add a predefined variable named sf_Id to write data back into Salesforce. See example below.

sf_ID

The Zingtree Agent Scripting app can read data from Salesforce and show it in the script, or automatically branch using that variable in a Logic Node. It can also update your Salesforce object record instantly, either from a data entry field or a button click. This works by setting up a simple field mapping. For example, if the Salesforce field API Name is FirstName, the corresponding field in Zingtree would be called sf_FirstName.

In this example, we’ll show you how to update a Salesforce case record from a button click. This will update a field called Product in Salesforce.

First, you’ll need to get the Salesforce API name of the field.

  1. In Salesforce, go to Setup, Object Manager, and click on the object type – here we’ll choose Case:

    2022-07-01_10-10-25.png

  2. Click on Fields and Relationships:

    2022-07-01_10-26-44.png

  3. Copy the API Name of the field next to Product. In this example it’s Product__c (Note the use of the double underscore in the Salesforce API name. The “__c” suffix is used in the API names for custom fields in Salesforce. It’s important to include it when working with custom fields.)

    2022-07-01_09-03-50.png

  4. The corresponding field name in Zingtree will be sf_Product__c. Again note the use of the single underscore after "sf" and the double between Product/c. 
  5. Now, open your tree in Zingtree and go to the node where you want the field assignment to occur.
  6. Under the Question and Action Buttons section, make sure Variable(s) to set on button click is ticked, then enter the mapped field name that begins with sf_ (sf_Product__c in this example), and set the corresponding values next to each button.

    2022-07-01_09-09-41.png

Now, when the iPhone button is clicked, the Product field in the Salesforce Case will be filled with iPhone.

Note that this technique also works for Data Entry Fields.

Predefining Variables to Map

Important: If you are just displaying fields from Salesforce inside of Zingtree, you will need to predefine them using the Zingtree Variables tool. Here’s how:

  1. From your tree in Zingtree, go to Information, Variables.

    2022-05-18_10-27-35.png

     

  2. Click Add Predefined Variable.

    2022-05-18_10-30-32.png

  3. Enter a variable name that begins with sf_  (sf_CaseNumber in this example).

    2022-07-01_09-22-09.png

  4. Click Save & Close when finished.

Important Notes

  1. You can reference a related record up to 4 connections deep via Lookup Fields (not related Lists) using the “–” character in your Zingtree predefined variable. As an example, if you are in a Case, you can access the First Name field on the related Primary Contact for the case using:
    sf_Contact-FirstName
      • An example of multiple object traversal would be accessing the related Account name for the related Contact on the Case. The predefined variable in Zingtree to accomplish this would be
        sf_Contact-Account-Name
  2. When calling Standard Salesforce Lookup Fields you will note that the API name has “ID” attached to the end. For example, If we're looking at the Contact field on the Case object, we will see the API Field Name is ContactID. In order to surface the Contact name in your zingtree you will need to drop the ID suffix from the end of the variable name.
      • Example (Standard Salesforce Field): Assuming your tree is launched from the Case Object, you can resurface information from the Contact field
        Name

        using the following variable format:

        sf_Contact-Name
  3. If you're referencing a Custom Lookup Field you will not need to drop the word ID from the API field name, but you will need to change the __c to __r (remember that these are double underscores). In the below example assume that you've set up a custom lead ID in your contact object and you're trying to reference it in the tree in your case object.
    • Example (Custom Field): Again assuming your tree is launched from the Case Object, you can resurface information from the Contact field
      Name
      using the following variable format:
      sf_LeadId__r-Name
  4. Fields in the immediate Object being referenced update in real time (on click)
  5. To see the update of the related Object in Salesforce, the browser window must be refreshed.  
  6. Currently, only STRING, INT, and DOUBLE fields are supported. 


    Overriding the Tree ID from an individual Record


    You can have different trees appear based upon a custom field in any record – this will override any object level or global level configurations you’ve set. Here’s how to do it:

    1. Add a custom field named Zingtree_Tree_id__c to your object. It should be a 12 character text field.
    2. If there’s a value in this field, it will be used as the tree ID instead of any other configuration. If it’s blank, the configuration ID is used instead.

 

Was this article helpful?

1 out of 2 found this helpful

Have more questions? Submit a request

Didn't find what you need?

Our friendly customer support team is here to help

Submit a Ticket

Looking for help or advice?

Reach out to our knowledgeable community of users.

Zingtree Community