1

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?

  • 1
    Did you try giving isConverted value false before passing to doFind method? – tugce Aug 12 '16 at 6:30
  • Thanks for the suggestion! Guess I'm not sure how to pass a boolean through this API... You can see that I'm trying to pass IsConverted as '' <input type="hidden" name='liveagent.prechat:IsConverted' id='isconverted' value=''/> – Doodereeno66 Aug 12 '16 at 14:05
1

Simple fix - and it was right in the documentation:

`'

it's the false. I thought that was the first thing I tried, but apparently not...

Thanks everyone!

  • To clarify, I'm pretty sure @Danomyte66 is saying that for the hidden liveagent.prechat:IsConverted field, instead of using '' as the value it is correct to use 'false'. – Rob Alexander Jun 15 '17 at 19:20
0

Okay, so I've tweaked your code a bit. I think it works just fine.

You only needed to add IsConverted to ExactMatch line. It should look like this;

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

<input type="hidden" name="liveagent.prechat.findorcreate.map:Contact" value="FirstName,LeadFirstName;LastName,LeadLastName;Email,LeadEmail" />

<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;IsConverted,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" />
  • Thanks! I actually had that in my code - didn't show it on my post. It's still not working. Now, when the chat is being requested, the live agent chat detail show IsConverted as coming in blank... – Doodereeno66 Aug 12 '16 at 15:53
  • So do you have two lines of isExactMatch:Lead or you posted earlier version of your page? I'm at lost on this moment. I'm posting my pre chat survey page a bit more. It works (Does not show converted lead, only contact) – tugce Aug 12 '16 at 16:05
  • I did have this line: `<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Lead" value="Email,true;IsConverted,true" />' – Doodereeno66 Aug 12 '16 at 16:33

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.