Output printing as [object object] .

Deepthi13
Tera Expert

script include : i want 3 values and i am getting 3 logs , but in client script i am getting error , can someone  please suggest

find_real_file.png

client script :

 

function mycallback(answer) {
answer = JSON.parse(response.responseXML.documentElement.getAttribute("answer"));
//answer = JSON.parse(result);

var adgroup = answer.var1;
var url = answer.var2;
var orgsuffix = answer.var3;
alert('two');

g_form.setValue('ad_groupp', adgroup);
g_form.setValue('U_URL', url);
g_form.setValue('org_suffix', orgsuffix);
alert("ad grp is " + adgroup);
alert("url is " + url);
alert("os is " + orgsuffix);

}

return false;

}

17 REPLIES 17

 @Ankur Bawiskar  , again i can see answer is object

find_real_file.png

are the fields getting set correctly?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Answer is getting in alert ,and it is setting on form level but not showing on RITM variable editor

can you put

alert("response is " + response); //as the first line in the call back and paste the result as string.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Hi @Ankur Bawiskar  Answer is getting in alert ,but it is NOT setting on RITM page variable editor, it is showing "none" only.

FYI, the variables are hidden on form level by using UI policy

 

Please suggest