Set variable mandatory on catalog task based on other variable

BijoyDeb
Tera Contributor

Hi All,

I searched on community a lot for this use case, but nothing that can fit in my requirement

I have three variable on my catalog---

Application - refers to cmdb ci

Category - choice

Subcategory - choice

 

Category and subcategory are always visible on catalog item, but not mandatory.

But, lets say if application is linkdin and user is trying to close the catalog task, in that case both category and subcategory should be mandatory.

 

I thought of writing ui policy oncatalog task, but I can't select variable or question in filter conditions

 

BijoyDeb_0-1729012331006.png

What is the way that I can fulfill this scenario.

Any guidance will be appreciated

 

Thanks in advance!!

 

 

6 REPLIES 6

Voona Rohila
Kilo Patron
Kilo Patron

Hi @BijoyDeb 

You can write a Catalog UI policy on the Catalog item and make 'Applies on Catalog Task' to true, The policy will run on Catalog task record.

VoonaRohila_0-1729021324581.png

 

https://docs.servicenow.com/bundle/xanadu-servicenow-platform/page/product/service-catalog-managemen...

 

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Voona Rohila
Kilo Patron
Kilo Patron

If your conditions are based on fields available on the ctask form then you can write client script and access variables using below syntax

g_form.getValue('variables.variablename'); // access variables info on client script.

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

@Voona Rohila I tried with client script, but not working

Can you share the logic you tried?

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP