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.

Approval based on list collector

carlc
Kilo Contributor

Anyone has any luck creating approvals based on items selected from a list collector. I have a list of 255 items and each have their own approval groups.

6 REPLIES 6

awesomevaran
Tera Contributor

Can you elaborate your question?


I have a list collector that references a table. Tis table has values and each value has a different approval group needed. Value A = Approval Group A. The are 255 different values so the list collector is the most efficient way to put it on the customer facing form.


Alikutty A
Tera Sage

Hello Carl,



You can access the list collector values in your workflow, It should return a list of comma separated list of sys_id.



If your list collector is referring to group table then you can add the following script in the advanced script of approval group activity



var answer = [];


var collector = current.variables.list_collector_variable.toString(); // (Replace list_collector_variable with your variable name)


var list = collector.split(",");


for(var i=0; i< list.length; i++){


  answer.push(list[i]);       // push each approval groups


}




Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


carlc
Kilo Contributor

Where do I reference the approval group?