how to convert array of objects to Reference in flow designer?

John_123_Snow
Mega Expert

I have a following Script Step where I am getting Approval group's sys_ids (ie. 3 sys_ids) 

find_real_file.png

 

After this I would like to use this approvalGroup object where the sys_id's are store in Ask for Approval Action....but it takes only reference fields, so drag and drop does not work? How can I achieve this so I can store this for Output.

 

otputs.approvergroups = approverGroups; returns

{approverGroup: 'sysID1'},{approverGroup: 'sysID2'},{approverGroup: 'sysID3'},

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@John.123.Snow 

what are you trying to achieve?

Are you having list collector variable in your catalog and wish to iterate over?

refer my blog around that

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

Regards
Ankur

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

I am trying to get the 3 groups by sys_id so they can be used/ drag and drop in Ask For Approval, I guess I can do it this way like you did. Do the look up records, sys_id in query...;) 

Hi,

So why not script directly in the Ask For Approval f(x)?

Regards
ankur

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

It is very complicated to why? This approvals have to be gotten from MRVS, based on other variables involved. This is the one of the efficient ways. because the object will be used later. Can't really explain the entire process. However,

find_real_file.png

iit still does not create approvals, when I log "3.1 Group Records" it logs two correct sysIDs of groups but in two logs, not one seperated with comma.