Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

multiple approvals not triggering from a list collector variable

Sri56
Tera Contributor

Hi Team,

 

I have one list collector variable for 'additional approver' field which has defined in a flow to trigger approvals.

Its working for one record.

However not for multiple records, i tried with Look up records action with for each logic but still didn't work.

Sri56_0-1782716585196.png

 

 

Can anyone please help on how to fix the same.

 

Thanks,

Sri

20 REPLIES 20

KMShan
Giga Contributor

Get the list collector value (Comma separated sys_ids)

Split the string into an array

       Use a script step or script action:

       return

               fd_data.trigger.current.variables.additional

              _approver.split(",");

For each *Loop through the array of sys_ids

Look up for record

    table: sys_user

    condition;

          sys id=current item

Ask for approval * Approver=looked-up user record

 

If you are using catalog item approvals, you can avoid the loop by writing a flow script that returns an array of approvers or use an Approve Rule if it fits your requirement.

 

 

 

Sri56
Tera Contributor

Hi Shan,

 

May i know where to include this list collector seperated value?

is it after look up records?

 

Please help!

 

Thanks,

Sri

Bhavya11
Mega Patron

Hi @Sri56 ,

 

Please refer this article

Using list collector in Flow Designer 'For Each loop' by converting string into array of string 


Regards
BK
LinkedIn: https://www.linkedin.com/in/bhavyashree-karanth-55032a121
YouTube: https://www.youtube.com/@NowWithBhavya

Sri56
Tera Contributor

still not working!!