function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lniet001lniet001 

Live Agent Pre-Chat Query

I have a pre chat form, and used the following three query tag:

  • <input type="hidden" name="liveagent.prechat.query:Email" value="Contact,Contact.Email"/>
  • <input type="hidden" name="liveagent.prechat.query:Name" value="Contact,Contact.Name"/>
  • <input type="hidden" name="liveagent.prechat.query:PantherId" value="Contact,Contact.Student_Id__c"/>

The first two work but the last one does not.

Does anyone know where to find documentation about this queries? The developer guide only provided an example.

Is there a different syntax for custom fields?

JimmyK12JimmyK12

I just ran into the same problem and here's what I found. So long as you use the same label as the field on the form that corresponds with the input field. Keep in mind that the label that you use is what is seen in the liveAgent console so you might want to use "Panther ID" instead of PanterId.

 

see below 

 

<input type="text" name="liveagent.PantherId" />
<input type="hidden" name="liveagent.prechat.PantherId" value="Lead,Lead.Student_Id__c"/>

 

Let me know if that works for you

Pete KnollePete Knolle

Found the following Help article which was helpful: http://help.salesforce.com/apex/HTViewSolution?id=000159850&language=en_US.  It gives more than the just the example in the developer's guide and gives some more explanation.

 

Pushing data from Pre-chat form to Live Agent console/Querying data in console using Prechat form's value/Saving values directly from Prechat form


Knowledge Article Number: 000159850 


Description

customer can  perform several operation from Prechat form like Push data to console, Query data in console with a Prechat field value , save directly in chat transcript field 


Resolution
If customer wants to send any data/value which is on Prechat form to live Agent console so that Agent can see , they just need to add extra parameters in thier Page's elements.
 
Refer the below mentioned syntax to know how to add parameter:
 
<input type='hidden' name='liveagent.prechat:subject' id='subject' /><br /> 
 
Suppose you want to send any value which website Visitor fills in input field, so just need to give name as "liveagent.prechat:subject". This will send the value to console in "Subject" variable.
 
"liveagent.prechat:subject" : This Syntax will create a console variable and store the value in it so that Agent can see at thier end.
 
 
 
If customer wants to search any data/record in Org on the basis of value entered by Website Visitor. they can use following syntax:
 
<input type="hidden" name="liveagent.prechat.query:Casenumber" value="Case,Case.Casenumber" /> 
 
 
Here "liveagent.prechat.query:Casenumber"  will store the data of input field in "Casenumber" object and tries to search record related to this. This syntax "Case,Case.Casenumber" will let the console know that you need to search that value in which object's field. 
 
"Case,Case.Casenumber": Here First value is for object and second value is for object's field
 
As soon website visitor, fill all the information and click on start chatt, record related to casenumber/value will pop up directly into console , so Agent don't need to find it manually in the Org
 
 
If customer wants to save a value to a  field of chat transcript object through Pre-cht form , they can do this using the syntax mentioned below:
Email Address: <input type='text' name='liveagent.prechat:Email' /><br />
<input type="hidden" name="liveagent.prechat.save:Email" value="Email__c" /> 
 
 
"liveagent.prechat.save:Email" will pick up the value from above text box and store the value automatically at "email__c" custom field at chat end
 
value="Email__c" is specifying to which field value should store.
 
Note : If you want to see the sample code for this you can go to below mentioned link: