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.

Clear variable onChange

Sam Ogden
Tera Guru

Hi All,

On our record producer we have a variable called 'u_prod'.  This is a lookup select box which is a list of product models.

I have the following onChange catalog client script.  If the answer to u_prod is "Mobile App" it should set the value of the variable 'more_detials_answer' to "mobile_app' .  If the answer is not "Mobile App" it should clear the value in more_details_answer.

The script is correctly setting the value when I select the option of Mobile App.  If I then change the answer in u_prod thought it is not clearing the value.

Any suggestions where I am going wrong?

Thanks

find_real_file.png

1 ACCEPTED SOLUTION

Munender Singh
Mega Sage

Hi,

Kindly use:

g_form.setValue('more_details_answer','');

 

Regards,

Munender

View solution in original post

5 REPLIES 5

ranjith5
Kilo Explorer

use g_form.setValue('more_details_answers','')- which makes the field empty