
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 10:51 AM
Hello,
I have a catalog item where I have created a reference variable called "Requested by". If this field is the same user that the approval is going to I want the approval skipped.
How do I accomplish this?
Thank you in advance!
Joe
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 10:33 PM
You can use If activity with script just before your actual approval and return yes or no
if activity script
answer = ifScript();
function ifScript(){
// your logic to determine the approver here
var approver = 'your value';
if(current.request.requested_for == approver)
return 'no'; // output of this goes to next activity by skipping approval
else
return 'yes'; // output of this goes to approval activity
}
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-19-2021 11:48 AM
What I like to do when I have complex logic for approvals is to remove the approval logic to a script include so I can call it and perform all of my checks before generating the approval. Let me know if this sounds like something you want to try and I will look up my previous solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 12:30 PM
Thanks for the reply!
I was hoping to keep it simple and be able to do it in the 'When To Run' condition on the approval activity.
- Approver - Is Not - current.variables.requested_by
I just don't see a way to select "Approver". Do you know if this is possible?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 12:55 PM
It all depends upon who is approving it. The only reason why I choose to do it outside of the workflow is so it can be used in multiple workflows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 12:40 PM
Can you share the approval activity?