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 set the select box value to none or clear the select box

Pranay Verma
Tera Contributor

I want to clear the select box value after clicking ok in alert message.

 

I have written the below script but it's not working.

PranayVerma_0-1681363735881.png

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Pranay Verma 

try to use g_form.clearValue('variable/field name');

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

We have used g_form.clearValue('variable/field name'); 

but it is not working.

Aziz GUEYE
Tera Contributor

Use this alternative

g_form.setValue("variable_name", []);

Please check and let me know if still facing the issue.