How to Clear all variables in a catalog item

Bijay Kumar Sha
Giga Guru

Hi,

I've 4 variable sets and many variables in those variable sets. All the variables are be shown/hidden/mandatory depending upon the selection criteria.

How I can clear all the values on the catalog form, when I change my selection from one to another. 

Currently, when I'm selecting any variable required fields are getting showed up and I'm filling the values, but when I'm changing, it's keeping all the values. 

I've tried to write a script in the UI policy itself as g_form.clearValue('field_name'); but it's not working. 

 

I just want to reset all the field values once I toggle between different variables or choice values in a variable. 

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

For clear the variable value:

- 2019-07-16 - Article - Clear the field value / Clear the variable value

- 2024-06-17 - Article - No code Clear the Variable value / Set Variable values (Washington DC)

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn