Mark Field value with the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 01:13 AM
@Ankur Bawiskar @Maik Skoddow @Sohail Khilji @Community Alums
Please help me how can I set uncheck checkbox field value & Another field value contains X
SEE THE SCREENSHOT below where can i write the script & help with the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 01:16 AM - edited 05-29-2024 01:18 AM
Hi @ARAVINDA11 ,
Create a On change client script on city field like below:
var city = g_form.getValue('city');
if (city == 'X'){
g_form.setValue('u_customer', false); // if the city is X then the customer field will be set to unchecked
} else {
g_form.setValue('u_customer', true); // if the city is not X then the customer field will be set to checked
}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 01:17 AM
Hi @ARAVINDA11 ,
Could you please explain a bit more on what you are trying to achieve ?
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 02:46 AM
Are you saying you want to check uncheck the checkbox based on City value?
If yes then you can use UI policy for this OR onChange client script
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader