6

I am trying to create a case once the visitor submits the pre-chat form but is not working, the record is not created. I managed to get it working using the deployment API but not from the pre-chat form. My guess is that I am not using the correct syntax but there aren't any good examples in the documentation for this.

This is a snippet from my pre-chat form. I want to populate the origin field with the value "Chat", this is obviously just for testing purposes, I want to populate multiple fields and show the case to the agent when he/she accepts the chat.

<input type="hidden" name="liveagent.prechat:origin" value="Chat"/>
<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="origin,liveagent.prechat:origin;" />
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:case" value="true"/>

Thanks

4

Example: Create a case with the value "Chat" as Origin.

<input type='hidden' name='liveagent.prechat:caseorigin' value='Chat'/>
<input type='hidden' name='liveagent.prechat:caseContactId' value='{!$User.ContactId}'/>

<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" value="Origin,caseorigin;ContactId,caseContactId;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Origin,true;ContactId,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Case" value="Case" />
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />

UPDATE: I discovered the field names are case-sensitive.

UPDATE: I have updated the example to show how to add multiple fields.

  • Were you able to set multiple fields? If you have to repeat some of the input names, it seems like it could have issues, e.g., two inputs going to the server would have the name of liveagent.prechat.findorcreate.map.doCreate, although maybe not. Just curious. (Agree on the docs needing updating) – Peter Knolle Jan 15 '14 at 2:58
  • Yes, I have updated the example to show how to populate multiple fields. – PepeFloyd Jan 15 '14 at 8:45
  • Awesome! I played around with it more. I could not find much documentation outside of the guide, so I documented my experimentation with it in this article. – Peter Knolle Jan 16 '14 at 1:41
  • Really good article! – PepeFloyd Jan 16 '14 at 19:59

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.