I am using snap-in with pre-chat enabled to implement chat functionality on our website. I am using the code snippet that is generated by the snap-in. Everything works great but I have 2 questions:

  1. I want to hard code the field "origin" of the case object in the pre-chat code. I am not sure how to insert that into the pre-generated code snippet. I have copied the code snippet below.

  2. The pre-chat form has from the snap-in has only limited number of fields available out of the box. For example, if I have a custom field on the case object, that custom field isn't available on the pre-chat form. How can i make custom fields available?

enter image description here


have you got a chance to visit the URL: https://help.salesforce.com/articleView?id=000264797&language=en_US&type=1

You might find your solution

| improve this answer | |
  • If this link answers the question, please edit your post to include relevant content here. – Adrian Larson Jan 31 '19 at 14:28
  • I added the following code to the pre-chat snap-in code, but it doesn't work i.e. it doesn't set the case origin to the value specified. embedded_svc.settings.extraPrechatFormDetails = [{"label":"Origin","value":"CompanyX","transcriptFields":[],"displayToAgent":true}]; embedded_svc.settings.extraPrechatInfo = [{"entityName":"Case","showOnCreate":true,"saveToTranscript":"Case","entityFieldMaps":[{"isExactMatch":true,"fieldName":"Origin","doCreate":true,"doFind":true,"label":"Origin"}]}]; – degmo Feb 1 '19 at 0:17

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.