Skip to main content

Hi everyone. Does anybody know if it is possible to find existing contacts by email and recordtypeid when using lwc for a custom prechat form on an embedded service?

 

Before the lwc we were able to do this with the standard prechat form by customising the embedded service snippet settings js file. 

 

Those customisations looked like this:

<script type='text/javascript'>

var initESW = function(gslbBaseURL) {

embedded_svc.settings.displayHelpButton = true; //Or false

embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US'

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":"RecordTypeId",

"value":"0127F000000Hj9CQAS",

}];

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"

}, {

"doCreate": true,

"doFind": true,

"fieldName": "RecordTypeId",

"isExactMatch": true,

"label": "RecordTypeId"

}],

"entityName": "Contact",

"saveToTranscript": "Contact",

"showOnCreate": true

}];

#Live Chat #Live Agent Chat #Live Agent Web Chat 

11 Antworten
  1. 12. Jan. 2022, 01:05

    @Andy Kallio I can not provide developer support Im afraid, (we do have the developer forum) my suggestion was to not do this in code at all and to use omnichannel flow instead.

    there are also options to not have to do this with any customisation that you may not be aware of, we will reach out offline

0/9000