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
murielmuriel 

Live Agent - pre chat form not picking up login user details

HI,

We have been implementing live agent recently in our organisation.  It works fine except when it comes to the pre chat form.

The pre chat form doesn’t pickup the value of the current user.

I have found several articles online but nothing seems to work.

When I try to retrieve the current user using ‘:UserInfo.getUserId’, I get the chat site guess account instead.

Basically the chat button lives in the customer portal.  Customer portal users need to be logged in to access the portal. 

Once they click on the chat button, it redirects them to the chat site. And somewhere along there, the login information is lost.

I was just wondering if anyone has had the same problem and if they are aware of a workaround. 

We don’t want to ask users to log in again into the chat site.  We should be able to pick this information from the customer portal, shouldn’t we?

i have tried changing the code behind the button script to something like that:

<script type='text/javascript'>
            liveagent.addCustomDetail('Contact Email', '{!liveAgentUserEmail}').map('Contact', 'Email', false, true);
            liveagent.addCustomDetail('Contact Name', '{!liveAgentUserName}').map('Contact', 'Name', true, false);
            liveagent.setName('{!liveAgentUserName}');
            liveagent.init('https://d.la7cs.salesforceliveagent.com/chat', '{!LEFT(liveChatDepId, 15)}&userId={!$User.id}', '{!LEFT($Organization.id, 15)}');

        </script>

but it doesn't do much.

Please let me know if you have any suggestions,

Thanks