- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 12:06 AM
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:
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 05:41 AM
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
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 12:48 AM
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
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.