- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:03 AM
Hi
I have a requirement to get a Text box displayed when an Checkbox is selected how can i achieve this in service catalog
T
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:16 AM
Hi Gowtham,
You can use no code solution for this
Create catalog UI policy and add condition like.
checkbox variable is true
under UI policy action you can show other text box variable by setting visibility to true.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:11 AM
Hi Gowtham,
you can create onLoad catalog client script which applies to RITM and sample script below
UI Type - ALL
function onLoad(){
if(g_form.getValue('checkbox1variable') == false){
g_form.setDisplay('checkbox1variable', true);
}
}
please check below blog which says how to achieve this
Hide empty variables on RITM and TASK record
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:16 AM
Hi Gowtham,
You can use no code solution for this
Create catalog UI policy and add condition like.
checkbox variable is true
under UI policy action you can show other text box variable by setting visibility to true.
Thanks,
Dhananjay.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:25 AM
You can also use onChange catalog client script on checkbox variable.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(g_form.getValue('variable name')==true){ // enter correct variable name
g_form.setVisible('text box variable',true); // enter correct variable name
}
else{
g_form.setVisible('text box variable',false); // enter correct variable name
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2020 02:31 AM
Hi Gowtham,
you can achieve this by using UI policy or Client Script. I think the best way is UI Policy.
Please follow the below steps:
1. Create Variables under the catalog item.
2. create a Catalog UI policy.
3. click on new
4. In condition select checkbox(your variable) is true
5. In Catalog UI policy Action you need to select Textbox(variable name) is Visible True.
Client script:
if(g_form.getValue('variable_name')==true){
g_form.setVisible('textbox_variable',true);
}
else{
g_form.setVisible('textbox_variable',false);
}
Hope this helps!
If you have any more questions, please let me know.
If I have answered your question, please mark my response as correct and helpful.
Thanks,
Sriram