How to get approval within Flow from dynamic approvers (within multiple records)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2020 02:41 AM
Hi,
i want to create a subflow (with flow Designer) for approval of Service Requests. The approvers need to be looked up in another table (in this example from submitters of change models). I can lookup for the records. But afterwards i can not access the submitter-Field from this records to get them as approvers for the service request. How could i solve this?Its it not possible to get the submitters from the change model records.
- Labels:
-
flow designer
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2020 06:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2020 07:49 AM
no, i do not really have much experience with sripting especially in the flow designer... Maybe you can help me with some sample code?
I need to grab users from a table based on specific criteria and then once I have them send all of the users the approval request. so far in the flow designer I am only able to get an approval for a single user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2020 03:27 AM
Soooo, I didn't test it, but something like this might work.
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
fd_data._1_1__look_up_records.forEach(getApproverString);
var sys_ids = [];
function getApproverString(record) {
sys_ids.push(record.user.sys_id);
}
sys_ids_string = sys_ids.join(',');
return 'ApprovesAnyU[' + sys_ids_string + ']';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 05:34 AM
I looked at the code again from my last reply, and I think I used the foreach for an Array and not an object.
So, the answer for an object might look like this
var obj1 = {first: 'a928734hy23', second: '23948h2394h23'}; //replace this with your object
var sys_ids = [];
Object.keys(obj1).forEach(function (key) {
sys_ids.push(obj1[key]);
});
sys_id_string = sys_ids.join(',');
return 'ApprovesAnyU[' + sys_id_string + ']';