Mark Field value with the script

ARAVINDA11
Tera Contributor

@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

ARAVINDA11_0-1716970381572.png

 

 

3 REPLIES 3

Sohail Khilji
Kilo Patron
Kilo Patron

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....

LinkedIn - Lets Connect

swathisarang98
Giga Sage
Giga Sage

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

Ankur Bawiskar
Tera Patron
Tera Patron

@ARAVINDA11 

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?

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