How to make a field mandatory based on a choice selected from a variable set

Jesus Nava
Tera Guru

Hello Experts, I have a variable set type Add Row with a variable called "Service" which is a list collector.

find_real_file.png

what i need is that if a user selects "Other" from the list collector, a field that is not in the variable set called "Additional Comments" turns mandatory. I have done this with 2 regular  fields using a UI policy but not for a variable set, can you guide me on how to proceed?

find_real_file.png

Thank you

 

1 ACCEPTED SOLUTION

@Jesus Nava, May Bad!

yes, you are right in that case please revert it back to the variable set. In the run script's Execute if true field use setMandatory syntax like this.

g_form.setMandatory('variables.additional_comments', true);

Execute if false field write below

g_form.setMandatory('variables.additional_comments', false);

Regards,

Muhammad

Regards,
Muhammad

View solution in original post

11 REPLIES 11

One more thing to note UI string based conditions are case sensitive so please ensure to handle "Other" & "OTHER" separately in the UI policy conditions.

Regards,
Muhammad

Thank you for your help!