3

With an Embedded Chat Service, I want to populate the case's supplied name field with the name provided on the pre-chat form. Here is my extraPrechatInfo section. I can use "Last Name", but I'd like to concatenate First Name and Last Name. I can't figure out the syntax.

            embedded_svc.settings.extraPrechatInfo = [{
              "entityFieldMaps": [{
                "doCreate":false,
                "doFind":true,
                "fieldName":"LastName",
                "isExactMatch":true,
                "label":"Last Name"
              }, {
                "doCreate":false,
                "doFind":true,
                "fieldName":"FirstName",
                "isExactMatch":true,
                "label":"First Name"
              }, {
                "doCreate":false,
                "doFind":true,
                "fieldName":"Email",
                "isExactMatch":true,
                "label":"Email"
              }],
              "entityName":"Contact"
            }, {
              "entityName": "Case",
              "showOnCreate": true,
              "saveToTranscript": "CaseId",
              "entityFieldMaps": [{
                "isExactMatch": false,
                "fieldName": "Subject",
                "doCreate": true,
                "doFind": false,
                "label": "Subject"
              }, {
                "isExactMatch": false,
                "fieldName": "Origin",
                "doCreate": true,
                "doFind": false,
                "label": "Origin"
              }, {
                "isExactMatch": false,
                "fieldName": "SuppliedEmail",
                "doCreate": true,
                "doFind": false,
                "label": "Email"
              }, {
                "isExactMatch": false,
                "fieldName": "SuppliedName",
                "doCreate": true,
                "doFind": false,
                "label": "Last Name"
              }]
            }];
2
  • did you managed to make this work? I face a similar issue.
    – mascot
    Oct 7, 2020 at 19:24
  • Not with the javascript. I ended up making 2 custom fields on the case and then using a trigger to concatenate them. Oct 8, 2020 at 20:20

1 Answer 1

0

My solution for this ended up being to create two new fields on the case called SuppliedFirstName__c and SuppliedLastName__c. I mapped to those two fields in the embedded chat code. Then using a before save trigger or a before save flow, concatenated those two fields and populated the SuppliedName field. It is important to note that the fields don't get populated on Insert, only on Update.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .