- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 12:07 PM
We have created a custom field on the Approval table (sysapproval_approver) called "Approval Type". We use this to differentiate all the different approvals that may be created by a workflow.
In the classic Workflow Designer, we used to populate this field when the Approval is first created right in the workflow. We do this by creating another branch out of the step just prior to the Approval that waits a second, and then populates the Approval record that was just created.
So it looks something like this in our Workflow:
The script behind the "Run Script" action looks like this:
function addTexttoApprovals(){
var apprv = new GlideRecord("sysapproval_approver");
apprv.addQuery("sysapproval", "=", current.sys_id);
apprv.addQuery("state", "=", 'requested');
apprv.query();
while (apprv.next()) {
apprv.u_approval_type='Manager Approval';
apprv.update();
}
}
addTexttoApprovals();
This works great! We use this strucutre with pretty much every approval we create in our workflows.
We are trying to figure out how to do something like this in Flow Designer, but have not figured out how. This is one of the last obstacles we have in replacing the classic Workflows in our Catalog Items with the new Flows.
Does anyone know how this might be able to be done in Flow Designer? Hopefully, it is not too cumbersome (or it would kind of defeat the purpose!).
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 12:13 PM
Hi,
There is a similar action/flow logic in Flow designer called "Do the following in Parallel", that you could try.
Link to the Docs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 12:13 PM
Hi,
There is a similar action/flow logic in Flow designer called "Do the following in Parallel", that you could try.
Link to the Docs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2022 01:03 PM
But what would the other steps (Timer and this Run Script) look like in Flow Designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 06:25 AM
OK, I think I figured it out.
The "Wait for Duration" is the equivalent of the "Timer".
And then I created a "Look up Record" and looked up the Approval.
Then I created an "Update Approval Record" to update the Approval Type field on the Approval record I looked up.
Thanks for the help!