---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Setting a GlideRecord variable to 'NULL'

# Setting a GlideRecord variable to 'NULL' {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

GlideRecord variables (including current) are initially null in the database. Setting
these back to an empty string, a space, or the JavaScript null value will not result in a return
to this initial state.
Note:  
This functionality requires a knowledge of JavaScript. To set it back to the initial state, simply set the value to 'NULL'. Note that the update() function does not run on the current object but rather on the record. The object displays the initial value until it
is called again from the record.  
Note:  
Functionality described here requires the Admin role.

## Example 1 {#r_SettingAGlideRecordVariableToNull__section_rxv_wzv_msb}

    var grIncident = new GlideRecord('incident');
    grIncident.addNotNullQuery("assigned_to");
    grIncident.query();
    if (grIncident.next()) {
      gs.log("The incident record that is going to be updated is " + grIncident.number);
      gs.log("Previous Value of 'Assigned To' field: " + grIncident.assigned_to);
      grIncident.assigned_to = "NULL";
      grIncident.update();
      gs.log("Current Value of 'Assigned To' field: " + grIncident.assigned_to);
    }

## Example 2 (Business Rule) {#r_SettingAGlideRecordVariableToNull__section_sxv_wzv_msb}

    current.u_affected_value = 'NULL';
    current.update();


