- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 02:56 AM
Hello Friends,
I’m facing error messages when we are reading and printing all array values from for loop.
I have stored true/false fields into array.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:07 AM
Hi Basant,
this happens when you are trying to access something which has not that property
try below and check whether error comes or not
gs.info('Following Array Values : ' + gciscdP[checkboxes[i]]);
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 01:20 AM
Hi,
Did you get any solution,let me know i am also facing similar kind off issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 01:07 AM
Hi Basant,
Could you please check this once.
I am also facing similar kind of issue.
var add=gr.createDataSource(current,cei_number);
gs.log("outPut"+add);
var address = add.split('|');
gs.log("final address"+address);
//if(add.indexOf('PO Box')>-1||add.indexOf('P.O. Box')>-1)
if( add !='null' || add != undefined)
{
gs.log("first if");
var addre=address[0];
var str=addre.toString();
//var str=address[0].toString();
i am getting error when i read the address[0] value.
Thanks,
Uma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 03:08 AM
I got this working
var cb=['number', 'short_description'];
var gr = new GlideRecord('incident');
gr.get('9d385017c611228701d22104cc95c371');
gs.print(gr[cb[0]]);
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2020 12:01 PM
I am also getting the same error
Evaluator: org.mozilla.javascript.EcmaError: Cannot read property "0" from undefined Caused by error in script at line 12 9: var nm = gr1.name; 10: var len1=[]; 11: len1 = nm.split(' '); ==> 12: var cc = len1[0]; 13: var cod = new GlideRecord('u_country_code'); 14: cod.addQuery('u_code',cc); 15: cod.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2020 11:48 PM
Hi Bhupesh,
check by printing the value of nm in logs
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader