- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 01:51 AM
Just a quick (hopefully) trivial question.
I have a field on a table, the field has the word '(empty)' in it, so it is not literally empty, but instead states that it is (empty).
I have a script using the nil() GlideElement.
What I want to know, will nill() return false on this field? Because there is the string (empty) in there? Or does (empty) literally mean empty, therefore nill() will be true?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 01:57 AM
is it reference field or string type field?
if reference type field then it will be empty and nil() will be true. if its string type field then it is actually a string there so it will not give true.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 01:57 AM
is it reference field or string type field?
if reference type field then it will be empty and nil() will be true. if its string type field then it is actually a string there so it will not give true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 02:19 AM
Hi Harshvardhan, yes it is a reference field! So (empty) does mean empty and nil() is true. Great. Thanks for the answer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 02:23 AM
then nil() will be true here .
if my answer helped you, kindly mark my answer as correct and close this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-14-2020 01:58 AM
Hi,
that field holds a string value as 'empty' so it means it has some value and is not empty
so if that is string type then it is not nil
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