Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Mark Field value with the script

ARAVINDA11
Tera Contributor

@Ankur Bawiskar  @Maik Skoddow  @Community Alums  @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

Not applicable

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
}

 

 

 

 

swathisarang98
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

@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  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader