- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:06 PM
Hi All,
We have to fetch the list of records from the question_choice table whose length exceeded 80. Please help with the fix script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:19 PM
Hello
Please use the below script
var inc = new GlideRecord('question_chooce');
inc.query();
while(inc.next()){
if(inc.replacethefieldnamewhichyouwanttocompare.toString().length > 80){
gs.print(inc.sys_id);
}
}
Please mark answer my answer as correct based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:28 PM
Hi @Suvetha S ,
Try below script
var grch = new GlideRecord('question_choice');
grch.query();
while(grch.next()){
if(grch.text.toString().length > 80){
gs.info(grch.sys_id);
}
}
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:19 PM
Hello
Please use the below script
var inc = new GlideRecord('question_chooce');
inc.query();
while(inc.next()){
if(inc.replacethefieldnamewhichyouwanttocompare.toString().length > 80){
gs.print(inc.sys_id);
}
}
Please mark answer my answer as correct based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:28 PM
Hi @Suvetha S ,
Try below script
var grch = new GlideRecord('question_choice');
grch.query();
while(grch.next()){
if(grch.text.toString().length > 80){
gs.info(grch.sys_id);
}
}
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 08:02 PM
Thank you both