- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 05:29 AM
Hello
Im configuring a flow with some actions after appoval. I need to skip this approval if the requester is manger/ director etc. How can i add this on ask for approval action to skip and then perform action.
This can be done by an if condition, but it is duplicate work and needed a solution to fix this.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 06:37 AM
Ah okay.
Then why don't you create an after insert BR on sysapproval table and there you check
the requested for is manager/director, if yes change the state to no longer required.
This way the control moves further.
Mark the comment as a correct answer and helpful if this helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 06:54 AM
Hi,
The issue is when you use Ask for Approval it doesn't have any condition.
So you cannot make it conditional.
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
02-04-2021 07:05 AM
Yes, trying to minimize the duplicate actions that needs to be created again. Yes, Thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2021 01:07 AM
Hi,
you can even avoid inserting the record into sysapproval_approver table if the condition doesn't match in that way no notification would be sent and no record would be created
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
02-04-2021 05:53 AM
Hi,
Add a if activity in the workflow and there you can check like this
answer = ifScript();
function ifScript() {
//check here yoru conditions
var user = gs.getUser().getUserByID(current.request.requested_for.toString());
if(user.hasRole("manager") || user.hasRole("director")) {
return 'yes';
} else {
return 'no';
}
}
Link yes activity to the workflow.
Link no to link to the activity after approval.
Mark the comment as a correct answer and helpful if this helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2021 06:15 AM
Hi asif,
Not workflow, its for flow in flow designer.