- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2021 01:22 AM
I am giving the input as numbers ...ex(11011748,11011749)
I am trying to check for an empty string.
but it returns empty , even if i enter a string. -> (11011748,11011749)
Code sample
answer = (function () {
if(current.variables.clabel === "") //-----> my code to check the empty string
{
workflow.scratchpad.comments = 'Given label is Receiver Label';
return 'no';
}
return 'yes';
})();
please help
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2021 01:32 AM
Hi,
simply use this
gs.nil() method
answer = (function () {
if(gs.nil(current.variables.clabel)) //-----> my code to check the empty string
{
workflow.scratchpad.comments = 'Given label is Receiver Label';
return 'no';
}
return 'yes';
})();
Regards
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
05-05-2021 01:32 AM
Hi,
simply use this
gs.nil() method
answer = (function () {
if(gs.nil(current.variables.clabel)) //-----> my code to check the empty string
{
workflow.scratchpad.comments = 'Given label is Receiver Label';
return 'no';
}
return 'yes';
})();
Regards
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
05-09-2021 07:37 AM
I could see you marked my response as correct earlier and now it is not.
Would you mind marking my response as correct as that response was given quickly and accurately.
Regards
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
05-09-2021 08:29 AM
I think it's high time now taking all these screenshot and will be tagging the servicenow on twitter and mailing the community admin as well. You really need to learn some behaviour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2021 08:40 AM
Don't take it personally Aman.
I respect all the help you do for the community.
We all are here to help members.
At some places I have even mentioned that your response is proper and you should also get equal credit and recognition for your comments.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader