Changing field color based on Null Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 12:11 PM
ok let me explain this better..
i have a Multi Line Text Field "Field1" and i am using that field to Turn the Color of the text and backgroud of another Date Field "Field2" if "Field1" is not NULL
I know i can do it with out code but our requirement is that we need "field1" not being null to turn it
i have tried the following
javascript:current.justification_for_urgent_request != "" ;
javascript:current.justification_for_urgent_request != '' ;
javascript:current.justification_for_urgent_request != null ;
javascript:current.justification_for_urgent_request != ;
but nothing seems to be working and i don't fully understand why... any thoughts
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 06:09 AM
Hi,
please share your field style configuration
are you using correct field name here?
if it's custom table then should the field name not start with u_
u_justification_for_urgent_request
javascript:current.u_justification_for_urgent_request != "" ;
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
03-31-2022 06:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 06:40 AM
we changed the name of the U-field because they thought it was to long...
but it's the same as justification_for_urgent_request across the board
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 07:59 AM
Hi,
can you share the field configuration screenshot?
is the field u_urgent_justification present on RED Request table?
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
03-31-2022 06:51 AM
Have you tried one of the following
javascript:!current.u_justification_for_urgent_request;
javascript:current.u_justification_for_urgent_request.toString() != "";