Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to restrict users to select not less 2 records in list collector in serviceNow

Sowmya
Tera Contributor

The purpose of list collector is to select more than 1 records . Can we populate an alert message to select more than 1 record in list collector ServiceNow. Kindly let us know the update asap.

1 ACCEPTED SOLUTION

Amit Gujarathi
Giga Sage

HI @Sowmya ,
I trust you are doing great.
You can do it using the client script on change one.

Once the value is changed into the list collector it will be passed to the backend where it will be shown as comma seperated sysIds for the reference.

var glideList = g_form.getValue('<glide list field>');

It will give output as sys_id1,sys_id2.
Then you can split it as given below :
var glideListArray = glideList.split(',');

if (glideListArray.length > 2) {

alert ('Invalid')

}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



View solution in original post

5 REPLIES 5

Sowmya
Tera Contributor

Thank you so much its working