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.

how to get the count of selected values in list collector variable

niharikayb
Kilo Contributor

Hi,

I have an catalog item containing list collector variable in it . I have a requirement to get the " count of selected values of list collector variable " in the workflow associated with it .Workflow is on requested item table.

Please help me in solving the issue.

Thanks in advance,

Niharika

1 ACCEPTED SOLUTION

Harish Murikina
Tera Guru

Hi Niharika,



var variablename = current.variables.yourvariablenmae.toString(); // here it gives all values comma seperates


var splitthevalues = variablename.split(','); // Spli all variables by comma


var length = splitthevalues.length; // here you will get the length



Regards,


Harish Murikinati.


View solution in original post

2 REPLIES 2

Harish Murikina
Tera Guru

Hi Niharika,



var variablename = current.variables.yourvariablenmae.toString(); // here it gives all values comma seperates


var splitthevalues = variablename.split(','); // Spli all variables by comma


var length = splitthevalues.length; // here you will get the length



Regards,


Harish Murikinati.


Thank you so much Harish..