Request for new laptop

anilwillpower
Tera Contributor

need script for the below:

 

Operating System - Windows, Linux

windows 2018,windows 2016, windows 2014 - These options should be shown only when windows are selected on OS.

Ubunty, 2024 - These options should be shown only when windows are selected on Linux.

 

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @anilwillpower,

 

Are the fields choice list fields? 

Check the link below which has guidance on how to achieve this for both standard forms as well as catalog variables.

If the values are already displayed and you need to display or hide certain values, you should leverage the g_form methods:

- g_form.clearOptions()

 - addOption()

- removeOption() 

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

https://www.servicenow.com/community/developer-forum/choice-list-dependencies/m-p/2108594#:~:text=Ch...'.

View solution in original post

2 REPLIES 2

Robbie
Kilo Patron
Kilo Patron

Hi @anilwillpower,

 

Are the fields choice list fields? 

Check the link below which has guidance on how to achieve this for both standard forms as well as catalog variables.

If the values are already displayed and you need to display or hide certain values, you should leverage the g_form methods:

- g_form.clearOptions()

 - addOption()

- removeOption() 

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

https://www.servicenow.com/community/developer-forum/choice-list-dependencies/m-p/2108594#:~:text=Ch...'.

Weird
Mega Sage

Honestly this seems like a work order.
I recommend checking the documentation and using the community search. Most of the work order requests are usually identical to what has been asked.

As a hint you can for example create a client script and use g_form functions clearOptions and addOption to configure visible choices on a field.