Instead of value is "NULL" it was creating the empty record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 09:49 PM
Please find the script below. I am trying to insert the "value" field as a "NULL" string, but it is creating an empty record. Does anyone know why the string is being converted into an empty record?
Script:
var gr = new GlideRecord("sn_ti_observable");
gr.initialize();
gr.value = "NULL";
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 10:13 PM
Hi,
What is the data type of the field "value"?
Check if the field's backend name is correct or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 10:21 PM
Hi Amaradiswamy,
Thanks for your response.
Datatype is "String." I have checked the backend name; also, it's correct.
Whenever I tried with gr.value="xyz.com," it was properly updating into the field. But gr.value="NULL," then an empty record is created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 11:05 PM
Hello @balajibs ,
Using the string "NULL" as a value is not expected in ServiceNow. When assignig this value, the fieald is automatically cleared.
Please consider using a different word or assign a value like "N U L L" instead.
Best regards,
Hajar