How to set a reference field to null?

mitzaka
Mega Guru

Hi SNC,

 

What is the way to set reference fields to null (make them empty)?

I have an UI Action which clones a change and for the clone I am trying to empty the assigned_group field. My script goes like this:

 

var change = new GlideRecord("change_request");

change.short_description = current.short_description;

change.description = current.description;

change.cmdb_ci = current.cmdb_ci;

..................

...........

and so on, but this approach (change.assigned_group = null;) does not work for the reference field.

Any ideas?

5 REPLIES 5

marcguy
ServiceNow Employee
ServiceNow Employee

not even 'NULL' ? try that.


Nope, tried that, doesn't work.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

HI,



Can you please try with the below one


change.assigned_group = "";