Best Practices for Implementing Salesforce.com Snap-In for Live Chat

If you are trying to implement online chats for your customers in your website, one of the challenges you face in configuring Snap-Ins is that it shows all the values of picklist fields by default. This can be a real pain point if one of your requirements is to show a subset of those picklist values on the snap-ins form.  One option is to create several different record types, but for clients with more complex requirements, who needs multiple snap-ins in their websites this can cause a maintenance problem with too many record types.  On top of this issue, you cannot have a custom picklist field label that is different than the field label in Salesforce. These constraints bring about the challenge of how we display only a few picklist values and enable it for all snaps-ins on your website?

Sooraj Kesavadas, from Eigen X, faced this problem while implementing this requirement for a large manufacturing company. Some of the limitations we faced when implementing Snap-in chat were:

1. The picklist always shows all the values unless you are willing to create record types for each Snap in.

2. We cannot configure picklist mappings between what is available to the customer and what should be saved in the salesforce.

3. We cannot show custom filed label different from the field name in the back end.

4. Offline Snap-In chat does not provide the option to create Contact or Account

Figure - Snap-In Chat (Customer facing)

Figure - Snap-In Chat (Customer facing)

Figure – picklist field on Case created from Snap-In

Figure – picklist field on Case created from Snap-In

In order to solve all of the above issues, we created shadow picklist values which were displayed through the Snap in chat and at the end of the chat when the Case gets created, an Apex trigger will run which will get the mapping from custom metadata and perform the right mappings.

Figure - Case trigger handler querying custom metadata for picklist mappings

Figure - Case trigger handler querying custom metadata for picklist mappings

By default, Snap in creates Contact and Case records during online mode as the customer fills up the pre chat form. If you are using person accounts, person account record does not get created and so you would end up with orphan contact records.

Figure - Snap - In configuration for Online mode (Pre-chat form)

Figure - Snap - In configuration for Online mode (Pre-chat form)

When the snap-in is in offline mode, the out of the box snap-in configuration does not create contact or account record, it only allows case object.  As a result, the contact data that the customer fills in on the pre chat form will get lost. How do we regain the contact info of the customer during offline chat?

Figure - Snap-In configuration for offline mode

Figure - Snap-In configuration for offline mode

One of the solution that ended up working is to use the previously mentioned case trigger to query the data from the newly created case record such as first name, last name and email and check if there already exists person account matching these three fields. If the case trigger finds a match, the case could be attached to that person account or else a new person account will be created for the new case.

Figure – Case trigger checking if person Account with the same email exists

Figure – Case trigger checking if person Account with the same email exists

To summarize, here are the 3-key takeaway for you.

1. Snap - In chat is still in its nascent stage and while it provides some improvement over the Live Agent,   in order to overcome the limitations, you might have to use shadow fields to capture the data.

2. Once the case is created, a trigger can be set up which could do the picklist filed mappings, copy any data from shadow fields to the actual fields, creating contact and account or person account etc.

3. Snap in chat requires live agent to run.

Please feel free to email me at skesavdas@eigenx.com for any questions or feel free to post your comments below.