Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Shamma Negi
Kilo Sage
Kilo Sage

Hi All,

 

I have achieved this via custom script wherein we can allow user to select some specific number of values in list collector variable. If it exceeds more than 6 then it shows the error message and doesnt allow you to submit.

 

Let us see how:

 

We need to write a onSubmit() Catalog Client Script 

Field Name: Company

 

function onSubmit()

var values = g_form.getValue('list_collector_variable').toString().split(',');

if(values.length > 6){

alert('Please select only 6 values in company field');

return false;

}

}

 

Hope this helps.

I hope this article helpful. Please mark it as helpful and bookmark if you like it.

 

Regards,

Shamma Negi