Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.


#1 2022-10-20 11:55:11

New member
Registered: 2022-10-20
Posts: 2

can not get additional chat variable data

1.As Per document I followed steps and created additional chat variables but not getting data in rest api call

Here is my rest body raw json
    "base_url":{{lhc.add.base_url}} or {{lhc_var.base_url}} or {{lhc.base_url}} //passed  in three test cases

2.And created custom field  start form chat settings -> default settings -> custom fields here mention label and identifier and type as hidden and size as 6 and position as 0

3.Same way in additional chat attributes with identifier

4.Chat assign columns also done

Finally push prefill data as following script with required information as below all are getting except custom field data

    var username=$("#chat_username").val();
    var email='***.com';
    //var email=email;
    var baseurl=webroot;
    var LHCChatOptions = {}; 
     LHCChatOptions.attr = new Array();
    // LHCChatOptions.attr.push({'name':'baseurl','value':'dummy url','type':'hidden','size':6}); 
     LHCChatOptions.attr_prefill = new Array();   
    // LHCChatOptions.attr_prefill.push({'name':'baseurl','value':'dummy'});
     LHCChatOptions.opt = {widget_width:320};

(function() { 
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 
po.src = chaturl; 
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 

response as in my chatbox window  as below
hi testicon ***.com
{"headers":["Content-Type: application\/json"],"url":"apiurl","body":"{\n \"msg\":\"hi\", \n \"nick\":\"testicon\",\n \"email\":\"***.com\",\n \"base_number\":null\n}"}


#2 2022-10-20 12:19:37

From: Lithuania
Registered: 2012-09-23
Posts: 3,661

Re: can not get additional chat variable data


#3 2022-10-21 12:29:11

New member
Registered: 2022-10-20
Posts: 2

Re: can not get additional chat variable data

My question is when i passed as LHCChatOptions.attr_prefill.push({'name':'baseurl','value':'dummy'}); and calling json raw as { 'base_url':{{lhc.base_url}} } and {content_4} as the key for base_url it was showing as null i want here dummy


Board footer