Approval Process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I have a custom table, where I have 20 request types, and out of that 10 request types are having approvala,so have created a field called Approval Required in the configuration table,based on which approval is triggered.
But now the issue is for this 10 request types,how to manage the approvals.
There are 2 level of approvals and all are different,
in request type A 1st level of approval,goes to specific user A and 2nd goes to specific user B,this I can handle using two field Approver 1 and Approver 2 at the backend and will be hardcoded.
But in some cases approver 1 is the head of Dept which we will get from the catalog item upon selection by the user and approver 2 is the unit head,which also we will get from the catalog item.(Note-we don not have the department head and unit head approvers stored anywhere)
So,I need a scalable solution to manage the approval process from the backend.
How can we do that
Thanks,
karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @Kaustubh k ,
To achieve a scalable, maintainable multi-level approval process for your custom table with dynamic approvers that are not stored in ServiceNow, you should implement a solution that allows dynamic approver assignment via logic instead of hardcoding users per request type.​
Recommended Approach
1. Dynamic Approver Assignment
Catalog Variable Selection: When users select a department/unit in your catalog item, capture that choice using variables like "Department" and "Unit".​
Lookups or API Integration: Since department head and unit head approvers are not stored in ServiceNow, use one of these options to retrieve approver details:
External API Call: After form submission, trigger an integration (REST API call) to fetch the approver names/emails for Department Head and Unit Head based on the catalog selection.​
Mapping Table: Create an internal mapping or configuration table in ServiceNow that associates department/unit values with head names/emails; populate this table as needed for future scalability.​
2. Multi-level Approval Workflow
Use Flow Designer or Workflow to build a sequential approval flow:
Level 1 Approval: Set "Approver 1" based on the department head returned by your lookup/script/api call.
Level 2 Approval: Set "Approver 2" based on the unit head.
If the request type should use hardcoded users, populate fields accordingly; for dynamic cases, use the catalog variable logic above.​
3. Generic Approval Management
Make the workflow generic so it checks your configuration per request type and chooses:
Hardcoded assignees for static types.
Dynamic approvers for types needing department/unit heads.
Use script logic, Script Includes, or action steps in Flow Designer to set the Requested for Approval users dynamically for each level.
Best Practices
Do not hardcode users in flows—use dynamic lookup whenever possible for maintainability and delegation flexibility.​
Store mappings and lookups in an easily editable table, or call an external authoritative service for user information if not managed in ServiceNow.​
The workflow and flow logic should allow future expansion to more approval levels or new request types without extensive rework.​
Document the approval configuration for admin reference and onboarding.
This approach will let you flexibly handle static (hardcoded), mapped, and dynamic approvers for each approval level, driven by request type and catalog item selection, scaling as new departments and units are added.
You may find below thread helpful:
https://www.servicenow.com/community/in-other-news/handling-dynamic-approvals/ba-p/2283483
https://www.servicenow.com/community/itsm-forum/how-to-dynamically-assign-approvers-in-flow-designer...
https://www.servicenow.com/community/developer-forum/adding-dynamic-approvers-to-requested-item-usin...
If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.
Thanks & Regards,
Mohammed Mustaq Shaik - ServiceNow Consultant - Lets connect on Linkedin:https://www.linkedin.com/in/shaik-mohammed-mustaq-43ab63238/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
please share some screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have many request types as shown in screenshot,for some of them we do not require approval,for some of them as mentioned in the screenshot ,we require 2 level of approvals.
We have a custom table,where I have created a field approval required based on that field approval is triggered,but how can we configure for this request types,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Kaustubh k ,
There are two approach for dynamic approvals, The approaches are as follows
1. Via Script
2. Via Decision table.
For Script, below reference is reference script
var routingGR = new GlideRecord('u_approval_routing');
routingGR.addQuery('u_request_type', current.u_request_type); // or whatever field points to type
routingGR.orderBy('u_level');
routingGR.query();
while (routingGR.next()) {
var approver;
if (routingGR.u_approver_type == 'SpecificUser') {
approver = routingGR.u_approver_value; // sys_id of user
} else if (routingGR.u_approver_type == 'RoleBased') {
if (routingGR.u_approver_value == 'department_head') {
var deptGR = new GlideRecord('cmn_department');
if (deptGR.get(current.u_department)) { // assuming u_department references cmn_department
approver = deptGR.manager; // Approver is department manager
}
}
if (routingGR.u_approver_value == 'unit_head') {
// Custom logic to find unit head, perhaps via another field on department or another table
approver = findUnitHead(current.u_unit); // Custom function you define
}
}
// Create Approval Task assigned to 'approver' for this level
// Example: createApprovalTask(approver, routingGR.u_level, current.sys_id);
}
And For decision table please refer the below product docs
https://www.servicenow.com/docs/bundle/zurich-build-workflows/page/administer/decision-table/task/cr...
Please mark my answer correct and helpful if this works for you.
Thanks and Regards,
Suneesh
Thanks and Regards,
Suneesh
