UI Policy on Workflow Variables based on stages

jonjon2_0
Kilo Contributor

Hi all!

I'm trying to setup a service request workflow. Within the requested item and workflow I have couple of variables setup.

During certain stages, users will be tasked with filling in some of these variables. I want to be able to make those variables mandatory to ensure they fill it in.

I've looked into the Catalog UI Policies and I can't seem to set the condition based on the stage of the request.

I've looked in the UI Policies in the catalog tasks that it creates, and variables doesn't seem to be an option for me to add UI Policies to.

I'm not sure if there's something I'm overlooking. I suppose there's the path of doing a script in the Catalog UI Policy, but want to see if anyone has dealt with this before and have a better idea before I try scripting since I'm not that good at it yet.

 

Thanks!

1 ACCEPTED SOLUTION

Joaquin Campos
Mega Sage

Hi,

 

Indeed this can be done through a policy:

You just need to set the propper condition in "When to apply" tab, selecting the corresponding value of the stage:

find_real_file.png

 

And then, to set variables as mandatory you need to set them in the script tab like this, where variable1 will be the name of your variable:

 

g_form.setMandatory('variable1', true);

g_form.setMandatory('variable2', true);

....

 

Hope it helps!

 

Joaquín

View solution in original post

1 REPLY 1

Joaquin Campos
Mega Sage

Hi,

 

Indeed this can be done through a policy:

You just need to set the propper condition in "When to apply" tab, selecting the corresponding value of the stage:

find_real_file.png

 

And then, to set variables as mandatory you need to set them in the script tab like this, where variable1 will be the name of your variable:

 

g_form.setMandatory('variable1', true);

g_form.setMandatory('variable2', true);

....

 

Hope it helps!

 

Joaquín