- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 12:58 AM
Hello Team
I have requirement to show different more information on one single variable in catalog item.
Example: Variable A has drop down B and C
when I select "B" in variable A then it has to show more information "first selection" in another variable "S".
when I select "C" in Variable A then it has to show more information "second selection" in "S" variable.
According to the selection it has to show different more information on the "S" variable.
Please help me to resolve it 🙂
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 01:54 AM - edited 04-20-2023 01:54 AM
Write a onchange client script on variable A and use below script to achieve your requirement
if(newValue=="B"){
g_form.showFieldMsg("S","firstSelection');
}else if(newValue=="C"){
g_form.showFieldMsg("S","SecondSelection');
}
I hope this helps!
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 01:15 AM
Hi @vinod9 ,
To show different information in a single variable based on the selection of another variable in ServiceNow catalog item, you can use the "Variable Dependencies" feature. Here are the steps to configure this:
Create your catalog item: Create your catalog item and add the "Variable A" and "S" variables.
Create new options for Variable A: For Variable A, create two options, "B" and "C", and add the additional information for each option in the "Help Text" field.
Configure the dependencies: Navigate to the "Variable Dependencies" related list for Variable A and create two new dependencies, one for each option:
- For option "B": Set the dependent variable to "S" and set the "Value When" field to "B". In the "Dependent Variable Display" field, add the information you want to display for "B" selection.
- For option "C": Set the dependent variable to "S" and set the "Value When" field to "C". In the "Dependent Variable Display" field, add the information you want to display for "C" selection.
- Test the catalog item: Save the catalog item and test it by selecting "B" and "C" options in Variable A to see if the additional information is displayed in Variable S as expected.
By following these steps, you can show different information in a single variable based on the selection of another variable in a ServiceNow catalog item.
Thanks,
Rahul Kumar
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 01:54 AM - edited 04-20-2023 01:54 AM
Write a onchange client script on variable A and use below script to achieve your requirement
if(newValue=="B"){
g_form.showFieldMsg("S","firstSelection');
}else if(newValue=="C"){
g_form.showFieldMsg("S","SecondSelection');
}
I hope this helps!
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 03:34 AM
@Prince Arora Thank you 🙂
It worked for me