Add an approver with IF condition

Burhan Shah
Tera Contributor

I want to add an approver to my current workflow only if a request is submitted by a user of a specific company and the approver will be the same for all requests submitted by a user of a specific company.

Below is the screenshot for your reference:

find_real_file.png

1 ACCEPTED SOLUTION

Not applicable

@Burhan Shah 

So take if activity and use the logic which I given in script section and code the yes node to new approval activity.

Let me know if any queries.

Happy to help:)

 

Thanks,

Murthy

View solution in original post

10 REPLIES 10

Hi Burhan,

Select an 'if' activity from the activities and in that write the code as mentioned by Murthy.

answer = ifScript();

function ifScript() {
    if (current.request.requested_for.company.name == "GIVE COMPANY NAME HERE") {
        return 'yes'; //trigger for approval
    }
    return 'no'; //ignore
}

 

after the if activity connect the yes to approval activity and no to go ahead without the approval activivty.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Nayan

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.