Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to clear the field using the UI Action?

Nakata1
Tera Contributor

HI All 

I have set the UI action script as below, but it doesn't work. What is the cause?

current.u_reference_field=='';
action.setRedirectURL(current);
current.update();

 

1 ACCEPTED SOLUTION

== is used to check if something matches. Single = is used to set a value.

View solution in original post

9 REPLIES 9

Namrata Khabale
Giga Guru

Hey Nakata,

Is there any condition on which basis of that field should clear value?

Regards,

Namrata.

Willem
Giga Sage
Giga Sage

Can you try this:

current.u_reference_field='';
action.setRedirectURL(current);
current.update();

== is used to check if something matches. Single = is used to set a value.

mr18
Tera Guru

Hi Nakata,

current.u_reference_field = '';
action.setRedirectURL(current);
current.update();