1

I am using an embedded service deployment to show a chat window on a publicly hosted webpage. This chat has a pre-chat form configured where I take in the contact details. I want to input some additional fields like subject and message from the user and store it in a custom field on the LiveChatTranscript Object record. The reason I am using a custom field instead of storing it directly on the Case is so that I can decide from the subject if there is an existing case that I should attach to the chat, or should I create a new Case.

Here is the code I am using for storing custom field Subject:

embedded_svc.snippetSettingsFile.extraPrechatFormDetails = [
    {
        "label": "Case Subject",
        "transcriptFields": ["CaseSubject__c"],
        "displayToAgent":true
    }
];

Even after adding this code, I am just seeing the FirstName, LastName, and Email fields which I have configured in the Pre-chat page and not this additional subject field.

I also need to confirm where actually we need to write this code and if I am missing anything.

1
  • 1
    did you managed to figure this out? I have a similar issue, the settings js don't work at all.
    – mascot
    Oct 7, 2020 at 19:20

1 Answer 1

1

You would have to update the "value" attribute for the field like below

embedded_svc.snippetSettingsFile.extraPrechatFormDetails = [
{
    "label": "Case Subject",
    "transcriptFields": ["CaseSubject__c"],
    "displayToAgent":true,
    "value": "Subject for the case"
}];

It's the value attribute that is mapped to the field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.