How to set the valude after clear the variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 01:10 AM
Hi All,
I have written on change catalog client script to clear the value on the variable.
Example:
Before clear the value i have default values need to set for the variable.
I have written the catalog client script:
Please help me on this requirment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 01:57 AM
Hi @nikhitha24
As per my lil knowledge, once a field value is clear it means the default value also get clear and now system will not use ootb default value. So you need to write script
May i know what is your exact use case
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:08 AM
Hi @nikhitha24 you can set the default value inside the below function
if (newValue == '') {
g_form.setValue('fieldname','value'); // this value will be set when newValue is empty.
}
Harish