How to use GlideAggregate with Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 10:31 AM
Hi I have a scheduled job that execute the script below, but I am using GlideAggregate to groupby the approver. But how I can accomplish this using flow designer so I can move scheduled job into Flow designer.
function execute() {
/* query approval table with GlideAggregate*/
var approval = new GlideAggregate('sysapproval_approver');
/* select only requested records */
approval.addEncodedQuery('state=requested^due_dateRELATIVELT@dayofweek@ago@6');
/* group by approver in order to get unique values (one distinct user at a time) */
approval.groupBy("approver");
approval.query();
while (approval.next()) {
/* Create a unique Scheduled Report */
createScheduleReport(approval.approver);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:14 AM
Looks like you may need to build something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:16 AM
Hi, I watched that video already, but don't quite understand how I can accomplish the use of the group by using Flow Designer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:39 AM
You need to add an input for it for the actions and the script and then add the code for it. You will probably have to also change the output so its a JSON object so you can output the results.