- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 07:28 AM
Hi Team,
I am getting 'Undefined' message below.Kindly help in resolving the same.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 11:45 AM
Hi @Community Alums ,
Please try this line
for (var i = 0; i < authrole.length; i++) {
if (sa != authrole[i] && pa != authrole[i]) {
authorityrole.push(JSON.str(objj));
}
}
gs.info('Roles1:' + authorityrole[0].objj.name);
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
05-22-2024 11:06 AM
Don't assign the object pushed to an array to a new variable. From there, you have 2 choices:
authorityrole.push(objj);
gs.info('Roles1:' + authorityrole[0].name);
or
authorityrole.push(JSON.stringify(objj));
gs.info('Roles1:' + JSON.parse(authorityrole[0]).name);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 11:45 AM
Hi @Community Alums ,
Please try this line
for (var i = 0; i < authrole.length; i++) {
if (sa != authrole[i] && pa != authrole[i]) {
authorityrole.push(JSON.str(objj));
}
}
gs.info('Roles1:' + authorityrole[0].objj.name);
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak