Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to skip RITM approval if Manager is the Requested By

Joe Weisiger
Giga Expert

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

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Joe Weisiger 

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

12 REPLIES 12

Hi Pranesh,  Here is the activity

find_real_file.png

You can add the if activity before the approval activity and check the conditions for the approval by using the script.

find_real_file.png

ccajohnson
Kilo Sage

Do you know who is approving? Is it the Requested for.Manager, or someone else?

Sometimes it will be Requested for.Manager.  We also have a field where we add customer approvers that is used for some items.

Ankur Bawiskar
Tera Patron
Tera Patron

@Joe Weisiger 

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader