Catalog item "clear the value" checkbox issue

Yogita11_
Tera Contributor

Hello, everyone.

 

Does anyone have a solution for the "clear the value" checkbox issue on UI Policy?

When we check the checkbox, the variable values on RITM disappear, and when we uncheck the checkbox, a problem occurs on the form (after checking and unchecking the conditional checkbox variable, the previous value of the variable that was supposed to be cleared remains). Has anyone found a solution? that it should function as "clear the value" on the portal but not vanish the value on the RITM.

 

Thank you

1 ACCEPTED SOLUTION

Just tested, it is indeed your setup that is wrong. You should use Clear the Variable value = true in combination with Visible = false.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

View solution in original post

16 REPLIES 16

Also see this article I wrote 5 years ago:
https://www.servicenow.com/community/developer-articles/clear-the-field-value-clear-the-variable-val...

 

MarkRoethof_0-1724870032385.png

 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Ramz
Mega Sage

Hi @Yogita11_ ,

 

In Ui Policy you have options as applies to catalog item, applies to Requested Item ,in that check on catalog item alone so that it will work only on portal

Please mark my answer helpful/correct if it resolved your query

Thanks

Yogita11_
Tera Contributor

 

Single line text variables are hidden true and it get populated when checkbox get checked. Therefore as you say's uncheck the applies on RITM, then that variables will not visible on RITM ot tasks.

See my comment. You issue is just due to a misconfiguration on your end.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Najmuddin Mohd
Mega Sage

HI @Yogita11_ ,
To overcome this issue, I use OnChange Catalog client script and clear the values of dependent fields using g_form.clearValue('field_name');

Hope this information helps you.

Regards,
Najmuddin.