How to send approval for multiple users from the variable values selected from Service catalog reqest.

Raja Ravindra
Giga Contributor

Hi all,

 

In a catalog item, we  created a multi-row variable set named Approvers.

In that i added one reference variable in that which refers to (sys_user) table. i.e.,  Approvers list.

Requestor will be able to  select multiple users by using that field.

My requirement is to send approvals for all the users who are  added to the Approvers list by the requestor from that request.

 

Please help me, with the solution, how to achieve this.

 

Thank you,

Raja.

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

So this is something which needs a script in workflow and in approval user activity.


You can write below script in that workflow approval activity.

 

answer = [];
var arr = [];
var spl = current.variables.internal_mvrs.getRowCount();//internal_mvrs is my internal name for variables set which you need to replace.
var mvrs = current.variables.internal_mvrs;

for (var i = 0; i < spl; i++) {
    var row = mvrs.getRow(i);
    arr.push(row.approver);
}
answer.push(arr.toString());

 

I tested this and it works.

find_real_file.png

 

RITM:

find_real_file.png

 

Thanks,
Ashutosh

View solution in original post

2 REPLIES 2

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

So this is something which needs a script in workflow and in approval user activity.


You can write below script in that workflow approval activity.

 

answer = [];
var arr = [];
var spl = current.variables.internal_mvrs.getRowCount();//internal_mvrs is my internal name for variables set which you need to replace.
var mvrs = current.variables.internal_mvrs;

for (var i = 0; i < spl; i++) {
    var row = mvrs.getRow(i);
    arr.push(row.approver);
}
answer.push(arr.toString());

 

I tested this and it works.

find_real_file.png

 

RITM:

find_real_file.png

 

Thanks,
Ashutosh

Hey, Can you please let me knowhow can we achieve the same in case of list  collector variable?