How to clear value of Date field or make it NULL/empty

NihalMankar
Tera Contributor

Hi All,

I want to clear value in the date field. (make date field blank/empty).

Please help


Field type: Date

Thank You


NihalMankar_0-1718263039718.png

 

I used below code but it did not work

var gr = new GlideRecord('u_cmdb_ci_appl_instance');
gr.addEncodedQuery('u_number=CI002158339');
gr.query();
while (gr.next()) {
   gr.setValue('u_stolen_decommissioned_date', '');
   gr.update();
}

 

 

 

1 ACCEPTED SOLUTION

Jitendra Diwak1
Kilo Sage

Hi @NihalMankar,

 

Could you please download the xml and open in notepad and find u_stolen_decommissioned_date field and make it empty there and upload the xml once again.

 

Please accept my solution if it resolves your issue and thumps 👍 up 

 

Thanks 

Jitendra 

Please accept my solution if it works for and thumps up.

View solution in original post

3 REPLIES 3

Jitendra Diwak1
Kilo Sage

Hi @NihalMankar,

 

Could you please download the xml and open in notepad and find u_stolen_decommissioned_date field and make it empty there and upload the xml once again.

 

Please accept my solution if it resolves your issue and thumps 👍 up 

 

Thanks 

Jitendra 

Please accept my solution if it works for and thumps up.

Thanks Jitendra, it works I want to update 1000+ records how can we do it ?

Hi @NihalMankar,

 

To do this, you'll have to run the tramsform map. Extract the data into Excel sheet and take one unique field as coalesce true. On transform map there is one field as copy empty field as true then update it. Else you will have write background script to do the same.

 

Please accept my solution if it resolves your issue and thumps 👍 

 

Thanks 

Jitendra 

Please accept my solution if it works for and thumps up.