- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 09:46 AM
How to show and hide 20 select option and on that basis 20 rich text/url field will show - catalog variable
e.g
my variable name - Select Choice - Options are - 1 ,2 ,3 ,4 ,5
RichText type or URL type variable - will be
now - when in select option i will select - 1 then it will show only - www.123.com
and so on.
could you help how i can achieve in catalog item ? client script or ui policy ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 10:00 AM
Hi @jaiho_rai ,
you can have on change client script on the choice variable
with switch case something like I have shown the screenshot you can display the related variables
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
switch (newValue) {
case '1':
g_form.setDisplay('richtext_backend_name', true);
break;
case '2':
g_form.setDisplay('urlORrichLablebackendName', true);
break;
//so on...
}
//Type appropriate comment here, and begin script below
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 09:56 AM
Hi @jaiho_rai
UI policy is best , as it is no code.
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
03-05-2025 10:00 AM
Hi @jaiho_rai ,
you can have on change client script on the choice variable
with switch case something like I have shown the screenshot you can display the related variables
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
switch (newValue) {
case '1':
g_form.setDisplay('richtext_backend_name', true);
break;
case '2':
g_form.setDisplay('urlORrichLablebackendName', true);
break;
//so on...
}
//Type appropriate comment here, and begin script below
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya