Updating Salesforce Cases from Decision Trees

salesforce and zingtree

If you are launching Zingtree decision trees from within Salesforce, you have the ability to update the case record from any node of your tree. Here’s a summary of how to do it:

  1. Make sure your Agent Script button or link is set up according to this article.
  2. Add a Connected App to your Salesforce.
  3. Add the Salesforce Object Updater app to your organization within Zingtree.
  4. On any node in your tree, have the app trigger to update the case.
  5. Any Zingtree variables that begin with sf_ will update the corresponding field in Salesforce.

Adding a Connected App in Salesforce

To set up your Salesforce Connected App:

  1. Login into Salesforce and navigate to Setup, Create, Apps.
  2. Under Connected Apps, click New.
  3. Fill in the mandatory fields.
  4. Check the Enable OAuth Settings box.
  5. In the Callback URL field, enter this URL:
    https://zingtree.com/apps/salesforce/auth.php
  6. Under Available OAuth Scopes select:
    Perform requests on your behalf at any time (refresh_token, offline_access)
    Access your Basic Information (id, profile, email, address, phone)
  7. Your OAuth configuration should look like this when finished:

  8. Click Save and make a note of the generated Consumer Key and Consumer Secret. These need to be entered in the next step.

Adding the Salesforce Updater App

To add the App, do the following:

  1. Make sure you are logged into your Zingtree account.
  2. In Zingtree, go to Account, My Apps.
  3. Select the Salesforce Object Updater app.
  4. Enter your Consumer Key and Consumer Secret from the previous task.

    Click Continue.

  5. Allow access to your Salesforce account. (You may need to log into the account first.)

The Salesforce: Object Updater App will now appear in the list of Apps in My Apps.

Triggering a Salesforce Object Update

Once the App is installed in your organization, you can trigger a Salesforce update from any node in your tree.

  1. Edit the node in Zingtree where you want the update to occur. When this node is reached by an end user, the updater app will trigger.
  2. Under Apps/Webhooks, select your new app Salesforce: Object Updater.

     

  3. Click Save Changes.

 

Setting up Variable Names

As a part of your Zingtree session, you can collect data variables. Any variable that starts with sf_ will be used to update the corresponding field in Salesforce. For example, if you have a Salesforce field named description, a Zingtree variable named sf_description will be used to update that field.

Adding a Session Transcript

To include the Q&A history of the Zingtree session in a case field, you need to add a special field named Zingtree_Transcript to your Salesforce Cases.

In Salesforce:

  1. Go To Setup, Build, Customize, Cases, Fields.
  2. Scroll down to Case Custom Fields, and add a new field.
  3. The Data Type should be Text Area (Long). Click Next.
  4. The Field Name must be Zingtree_Transcript. Other parameters are your choice. See this example:


    Enter the other parameters, then click Next.

  5. Make the field read-only for all users, then click Next.
  6. Pick the Case Layouts where this information will be displayed, then click Save.

Troubleshooting

In case things aren’t working as you expect, here’s what to look out for:

  1. Changes to your case may not be reflected right away. Sometimes reloading the case (refreshing the page) will show the updates.
  2. If a Zingtree variable starting with sf_ has no field name counterpart in Salesforce, then the update will fail.
  3. You can check the Zingtree Event Log (Account, Event Log) to see all operations with Salesforce. This will show successes and failed updates, with error messages in case of failure.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.