- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 12:18 PM
I couldn't figure out why I am getting list of [object Object] instead of incident numbers in client side. Here is screenshot example,
According to gs.log from ajax script, it able to display 16 correct incident number,
I am pretty sure I am not using a right returnJSON function. Do I need to decode or something?
Here a sample of my script,
var groupId = 'ad057f9d4f374200c93959dd0210c704';
alert("Group name is " + groupId);
var ga = new GlideAjax('OpenIncidents');
ga.addParam('sysparm_name', 'getincidents');
ga.addParam('sysparm_item', groupId);
ga.getXML(IncidentsParse);
function IncidentsParse(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
answer = answer.evalJSON();
//alert(answer.length);
var count = 1;
for(var i = 0; i < answer.length; i++)
{
var myTr = "myTr" + count;
var ticketTd = "ticketTd" + count;
alert("ticket is "+ answer[i]);
var row = document.createElement("tr");
row.setAttribute("id", myTr);
document.getElementById("myBody").appendChild(row);
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 01:14 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 01:02 PM
ah okay, I missed to notice that. Can you please share the script Include code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 01:05 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 01:14 PM
can we have like,
ans[i] = gr.number.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2018 01:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2019 08:13 AM
I was facing the similar issue.
It worked for me.
Thanks.