
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 04:54 AM - edited 04-28-2024 04:57 AM
Hi Team,
I have referred all the communites but not able to solve the problem.Below is my Script Include screenshot:
If you see below statement is printing proper values in the log:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 05:33 AM
Hi @Community Alums ,
Please check below code it works for me
var account = {};
var accList = [];
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', 'ed92e8d173d023002728660c4cf6a7bc');
inc.query();
if(inc.next()){
gs.print("here" + inc.caller_id);
account.name = inc.caller_id.getDisplayValue();
account.sys_id = inc.caller_id.toString();
accList.push(account);
}
gs.print(JSON.stringify(accList))
I tried same in my PDI with incident table and caller field
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 05:33 AM
Hi @Community Alums ,
Please check below code it works for me
var account = {};
var accList = [];
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', 'ed92e8d173d023002728660c4cf6a7bc');
inc.query();
if(inc.next()){
gs.print("here" + inc.caller_id);
account.name = inc.caller_id.getDisplayValue();
account.sys_id = inc.caller_id.toString();
accList.push(account);
}
gs.print(JSON.stringify(accList))
I tried same in my PDI with incident table and caller field
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 06:41 AM - edited 04-28-2024 06:42 AM
On Line#93 of your client script, can you try like this. It looks good to me except this line as using the same variable which is a string type and assigning an Object.
var b = JSON.parse(answer);
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 07:20 AM - edited 04-28-2024 07:26 AM
Hi @Community Alums
Dot-walking fields will not work as expected sometimes. Its better to covert them to string and then add it to the object
You can either use getDisplayValue(), getValue() or try adding an empty string ""
account.name = rel.company.name + "";
account.sys_id = rel.company.sys_id + "";