Cilent scipt

nameisnani
Mega Sage

Hi Team ,

 

Catalog Build 

 

When ever user selects [ Request Category >> Production access ] , Then short desp and Descp field should be not visible .

 

NOTE :- Short descp and descp fields coming from the variable set .

 

Can anyone please help me here , 

 

nameisnani_0-1709714448384.png

 

Thanks in advance 

 

1 ACCEPTED SOLUTION

shyamkumar VK
Kilo Patron

@nameisnani , You can Write on Change Client Script on Request Category and use below script 

 

var access = g_form.getValue('request_category) // replace with correct variable name 
if(acess=='production access'){
g_form.setMandatory('variablename', false);
g_form.setVisible('variablename', false);
}

 

 
UI Policy based on Condition like Request Category is Production Access , Create UI Policy Actions for both Short Description - Make Visible to True and Mandatory to False on both Variables 
 
Short Description - Visible False - Mandatory False 
Description - Visible False - Mandatory False 
 
Regards,
Shyamkumar
 
Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

View solution in original post

18 REPLIES 18

Community Alums
Not applicable

not from Chat GPT, internal  Servicenow  tool build based on Servicenow KB.

Great observation 🙂

Harish KM
Kilo Patron
Kilo Patron

Hi @nameisnani you can use UI Policy to make short description and description visible

Ui Policy condition:

Request Category IS Production access

Ui Policy action

variables as part of variable set will be visible here. It will display as (variablesetname-->variable)

select short description set visible to true

select description set visible to true

Regards
Harish

Hi @nameisnani it doesnt matter it's variable set or variables, variables would still display when you create a UI Policy as usual and apply on catalog item,

Regards
Harish

Anubhav24
Mega Sage
Mega Sage

Hi @nameisnani ,

Create Catalog UI Policy to hide those variables on your variable set. Keep in mind that this UI Policy will work on other catalog items as well if variable set is used on other catalog items , so kindly build a condition.

 

Please mark helpful/correct if my response helped you.