Approval based on list collector value

kun1
Tera Expert

Hi All,

 

 I have created a variable as a list collector type and create a new table(contains value) which refer to the list collector variable. 

Requirement is to attached the two level approval. First approval is the Requested for manager(Done) and second one is depend on list collector value.(If i selected more than one value in the list collector then it go for multiple approval). How can we attach approval based on list collector variable?

 

 

16 REPLIES 16

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Kun,

So if the list collector has 1 value then no second level approval is required

If list collector has more than 1 value then it should go to second level approval

So have an if activity and check following

answer = ifScript();

function ifScript(){

var listCollectorValues = current.variables.<listCollectorVariable>.toString();

if(listCollectorValues.split(',').length > 1)

return 'yes';

else

return 'no';

}

the yes output transition will take it to the 2nd level approval

the no output transition will skip and proceed to the next activity which you want

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

In the above script, where we check the list collector value.

If user selected as A, then this is the approver. 

If user selected as B, then this is the approver.

 

Thanks!!

Hi Ankur,

 

Any update!!

Hi Kun,

So you would require to get the displayValue for the list collector variable by querying the table it refers

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

approvers depend on the list collector value selected in the field.

 

If i selected A in the field then it go for the approver to some one.

If i selected B then it go for the approver to some one.

If i selected both a and b then it will go for the approver to both