how to convert array of objects to Reference in flow designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 04:43 AM
I have a following Script Step where I am getting Approval group's sys_ids (ie. 3 sys_ids)
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'},
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 04:46 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 04:50 AM
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...;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 04:54 AM
Hi,
So why not script directly in the Ask For Approval f(x)?
Regards
ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 06:32 AM
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,
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.