function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andy Kallio 13Andy Kallio 13 

Embedded Service prechat details works when used on website but not in community

Hello friends. 

I have just started working in a service cloud  org that is using  two different embedded service deployments for chat. One is used on a public salesforce community, and the other is embedded on a website.

There are two different code snippets, but the section in which the pre-chat settings are defined are the same. This is being used to find/create Contacts and populate some custom fields on the LiveChatTranscript record. 

I first noticed that the custom fields on LiveChatTranscript were not being populated very consitently. Then I found that the community deployment fails to populate thef fields most of them (93% failure), and that the website deployment works most of the the time (3% failure).

 

Looking across both sets of records, I have not able to find a consistent difference between the two that might serve as a clue into what is going wrong with our community deployement. So, now looking to the community for some ideas. Thanks!

Here is what the code snippet looks like for the community deployment.

 

window._snapinsSnippetSettingsFile = (function() {
console.log("Snippet settings file loaded.");	// Logs that the snippet settings file was loaded successfully
//liveagent.enableLogging(); //console errors on this line. therefore have no logs in console.
embedded_svc.settings.extraPrechatFormDetails = [{
	"label":"First Name",
	"transcriptFields":["PreChat_First_Name__c"]
	}, {
	"label":"Last Name",
	"transcriptFields":["PreChat_Last_Name__c"]
	}, {
	"label":"Email",
	"transcriptFields":["PreChat_Email__c"]
	}, {
	"label":"ChatStartSite",
	"value":"ADR-Website",
	"transcriptFields":["Chat_Start_Site__c"],
	}, {
	"label":"Brand",
	"value":"Adrenaline",
	"transcriptFields":["Brand__c"],
	}, {
	"label":"RecordTypeId",
	"value":"0127F000000ESNFQA4",
	}];

embedded_svc.settings.extraPrechatInfo = [{
			"entityFieldMaps": [{
				"doCreate": true,
				"doFind": false,
				"fieldName": "LastName",
				"isExactMatch": false,
				"label": "Last Name"
			}, {
				"doCreate": true,
				"doFind": false,
				"fieldName": "FirstName",
				"isExactMatch": false,
				"label": "First Name"
			}, {
				"doCreate": true,
				"doFind": true,
				"fieldName": "Email",
				"isExactMatch": true,
				"label": "Email"
			}],
			"entityName": "Contact",
			"saveToTranscript": "Contact",
			"showOnCreate": true
		}];

})();