Conditional Display of Choices in ServiceNow Catalog Item Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 11:29 PM
Hi,
I have created two multiple-choice variables in a catalog item:
- Laptop/Desktop (laptop/desktop) with two choices: Laptop and Desktop.
- Mode of Laptop Delivery (mode_of_laptop_delivery) with two choices: Shipping the Laptop and Picking it up from the Office Location.
The requirement is as follows:
- If the user selects Laptop in the laptop/desktop field, both options in mode_of_laptop_delivery should be displayed.
- If the user selects Desktop, only Picking it up from the Office Location should be displayed, and the other option should be hidden.
I tried implementing this with the following script, but it’s not working. Could you please assist me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 01:29 AM
@Community Alums Sure....I wil try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2024 12:12 AM - edited ‎12-06-2024 12:16 AM
Hi @Nikhitha Mohan ,
Using Multiple choice -> clearOptions() method doesn't work, try using Select box as variables, clearOptions() method will clear all the choices of the field. So, use addOption() and removeOption() instead