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?

2
  • 1
    Did you try giving isConverted value false before passing to doFind method?
    – tugce
    Aug 12, 2016 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=''/> Aug 12, 2016 at 14:05

2 Answers 2

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!

1
  • 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'. Jun 15, 2017 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" />
3
  • 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... Aug 12, 2016 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, 2016 at 16:05
  • I did have this line: `<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Lead" value="Email,true;IsConverted,true" />' Aug 12, 2016 at 16:33

You must log in to answer this question.

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