How to show and hide one choice value based on category selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:47 AM
If someone select category "A" on the portal then only sub category "X" should be visible.
And if user unselect the category from A to somthing else then sub category "X" should again be hidden,
Please suggestion how to do it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:53 AM
You need to to write the client script for the same.
As you are hiding the value.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:19 AM
I am writing below mentioned script but that one
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading ) {
if(g_form.getValue('category') != 'Business Application'){
g_form.removeOption('subcategory', 'Costa Loyalty – Poland');
}
return;
}
var cat = g_form.getValue('category');
var subcat = g_form.getValue('subcategory');
if (cat != 'Business Application') {
g_form.removeOption('subcategory', 'Costa Loyalty – Poland');
}}
is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:10 AM
Hi Vikas,
To avoid scripting, this can also be done using dictionary dependency. You can add dependencies in sub-category field for required category values respectively.
Please mark it helpful if I could help with your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:19 AM
This option is not aviable for portal fields/variables