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"/>



1 Answer 1


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) Jan 15, 2014 at 2:58
  • Yes, I have updated the example to show how to populate multiple fields.
    – PepeFloyd
    Jan 15, 2014 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. Jan 16, 2014 at 1:41
  • Really good article!
    – PepeFloyd
    Jan 16, 2014 at 19:59

You must log in to answer this question.

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