I have Live Agent up with the pre-chat APIs coded in the pre-chat form, as per the developer guide. I am attempting to find a lead or contact based on email provided in the pre-chat form. Here are the lines with the Live Agent Pre-Chat APIs:
<input type="hidden" name="liveagent.prechat.findorcreate.map:Lead" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail;Company,ContactEmail;LeadSource,LeadSource"/>
<input type="hidden" name="liveagent.prechat.findorcreate.map:Contact" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail;LeadSource,LeadSource" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Lead" value="Email,true;IsConverted,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Contact" value="Email,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Lead" value="Email,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Contact" value="Email,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Lead" value="FirstName,true;LastName,true;Email,true;Phone,true;Company,true;LeadSource,true" />
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Lead" value="true" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Lead" value="LeadId" />
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Contact" value="ContactId" />
It's almost working as intended, but the doFind method for the lead is including converted leads. So, when an email address for a converted lead is inputted to the form, the console displays both the contact AND converted lead.
My thought was to try and add IsConverted as part of the search:
<input type="hidden" name='liveagent.prechat:IsConverted' id='isconverted' value=''/>
<input type="hidden" name="liveagent.prechat.findorcreate.map:Lead" value="FirstName,ContactFirstName;LastName,ContactLastName;Email,ContactEmail;Company,ContactEmail;LeadSource,LeadSource;IsConverted,IsConverted"/>
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Lead" value="Email,true;IsConverted,true" />
But attempting to pass a blank value doesn't work.
Any thoughts here on how I might keep the converted leads from coming up?
<input type="hidden" name='liveagent.prechat:IsConverted' id='isconverted' value=''/>