make variables mandatory on variable editor

Vinya Jakkula
Tera Contributor

Hi Team,

Can anyone help me please. I have a field on variable editor when catalog task is close complete should be mandatory.

1 ACCEPTED SOLUTION

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello @Vinya Jakkula ,

 

You can use UI Policies (not Catalog UI Policies) on sc_task table with the specified conditions (meaning if catalogue item is so and so then......)  and make variable mandatory using Run Script

 

g_form.setMandatory('your_variable_name',true);

 

find below screen shots

 

RAMANAMURTHYG_0-1727245805386.pngRAMANAMURTHYG_1-1727245966098.png

 

 

 

 

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

View solution in original post

5 REPLIES 5

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello @Vinya Jakkula ,

 

You can use UI Policies (not Catalog UI Policies) on sc_task table with the specified conditions (meaning if catalogue item is so and so then......)  and make variable mandatory using Run Script

 

g_form.setMandatory('your_variable_name',true);

 

find below screen shots

 

RAMANAMURTHYG_0-1727245805386.pngRAMANAMURTHYG_1-1727245966098.png

 

 

 

 

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Thank you @RAMANA MURTHY G 

@RAMANA MURTHY G  changing back to another state still it is mandatory only.

got it.no issues working fine.