Salesforce: How to Integrate

  • Updated
  • 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 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.
    2022-07-01_09-52-07.png
    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 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 install the Zingtree App into Salesforce. Clicking one of the links below will redirect you to Salesforce for the installation:

    *Note: If you have previously installed Zingtree then clicking one of the above links will allow you to update to the newest version.

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

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

    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:

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

    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.

      2022-07-01_10-36-28.png

    3. Enter the API Key.  If you are logged in to Zingtree, you can find your API Key here.
    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 click Publishing > Publishing Links. The tree ID will be the string of numbers at the end of the publishing URL. 

      2022-07-01_10-37-42.png

    6. 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.

    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 Zingtree Agent Script component onto the layout wherever you like it to appear.

      2022-07-01_09-59-18.png

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

      2022-07-01_09-57-30.png

    9. Make sure to click Save when finished.


    Mapping Data Fields

    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 is called name, the corresponding field in Zingtree would be called sf_name.

    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 field name next to Product. In this example it’s Product__c (Note the use of the double underscore in the Salesforce API name. This is important.)

      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 an object one connection deep via Lookup Fields (not related Lists) using . So if you are in a Case, you can access the Contact for the case, but not an object related to the Contact. The variable naming process will be slightly different depending on if you're using a Standard Salesforce Field or a Custom Field.
    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 object from the Case object we will see the API Field Name ContactID. In order to surface the contact name in your zingtree you will need to drop the word ID 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.

  • Salesforce Integration Setup Video

    Overview

    For contact center use, Zingtree seamlessly integrates with Salesforce. 

    Your agents will see these benefits:

    • Convenient: Launch scripts right from within any Salesforce object.
    • Two Way data Transfer: Salesforce Object data can be displayed in the script. And data gathered in Zingtree can instantly update Salesforce.
    • Pause and Resume lets you transfer Cases (or any other object) from one person to another, and retain context and tree browsing history.
    • Flexible Configuration: Different decision tree scripts can appear for each object type or even a specific record in each object. 

    Here’s one way your decision trees can appear in Salesforce.

    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.

    Read this article to see how to include Zingtree session data in your Salesforce forms.

     

    Installing the App

    The first step is to install the Zingtree App into Salesforce from one of the links below:

    Once you install, you will be taken to the following page on SFDC

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

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

    The installation will finish, and you will receive an email once the installation is complete, which may take a couple of minutes.

    After the successful installation, you will see the following:

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

    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.

    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:
    3. Find and click on the name of the appropriate Permission Set (Zingtree Admin or Zingtree User).

    4. Click on Manage Assignments.

    5. Click on Add Assignments.

    6. Add whichever users you’d like.

      Note: The following are the permission sets applied to each user type. 

    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.

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

    3. Enter the API Key.  If you are logged in to Zingtree, you can find your API Key here.
    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.

    6. 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.

    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 Zingtree Agent Script component onto the layout wherever you like it to appear.

      2022-07-01_09-59-18.png

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

      2022-07-01_09-57-30.png

    9. Make sure to click Save when finished.


    Mapping Data Fields

    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. Also, it can 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 is called name, the corresponding field in Zingtree would be called sf_name.

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

    First of all, 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 a Case:

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

    2. Click on Fields and Relationships:

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

    3. Copy the field name next to Product. In this example it’s Zingtree__Product__c (Note the use of the double underscore in the Salesforce API name. This is important.)

    4. The corresponding field name in Zingtree will be sf_Zingtree__Product__c. Again note the single underscore between sf/ZingTree and the double underscore between ZingTree/Product and Product/c
    5. Now, open your tree in Zingtree, then go to the node where you want the field assignment to occur.
    6. Under the Content Tab, make sure Set Variable on Button Clicks is ticked, then enter the mapped field name that begins with sf_ (sf_ZingTree__Product__c in this example), and set the corresponding values next to each button.

    7. Make sure to save the changes.

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

    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 Tools, Variables.

       

    2. Click Add Predefined Variable.

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

    4. Click Add Variable when finished.

    Important Notes:



    1. You can reference an object one connection deep via Lookup Fields (not related Lists) using . So if you are in a Case, you can access the Contact for the case, but not an object related to the Contact. The variable naming process will be slightly different depending on if you're using a Standard Salesforce Field or a Custom Field.
    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 object from the Case object, we will see the API Field Name ContactID. In order to surface the contact name in your zingtree, you will need to drop the word ID 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 and 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.


  • Throughout 2022 Zingtree will be upgrading customers to our new faster and more modern user experience! Here's how to tell which experience your Zingtree Authors are currently using.

    Log in to your Zingtree Author account and navigate to My Trees. How does your current My Trees page look?

    Zingtree Classic

    2022-02-25_12-24-51.png

    New User Experience

    mceclip0.png

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request