Generate approval matrix #212
Closed
himanshu7895 wants to merge 9 commits intoServiceNowDevProgram:mainfrom
Closed
Generate approval matrix #212himanshu7895 wants to merge 9 commits intoServiceNowDevProgram:mainfrom
himanshu7895 wants to merge 9 commits intoServiceNowDevProgram:mainfrom
Conversation
|
✅ Valid PR for ActionPack Thank you for your contribution. This PR complies with the CONTRIBUTING.md. |
…finition_eae19e73c320721051c35ffdd40131bd.xml
…finition_85035c3bc320321051c35ffdd40131a4.xml
…finition_74773827c368721051c35ffdd4013164.xml
|
✅ Valid PR for ActionPack Thank you for your contribution. This PR complies with the CONTRIBUTING.md. |
Contributor
|
This still doesn't have an error evaluation step as requested in #205. Add an error evaluation step to handle if the script step fails Please reopen/submit a new PR after making the changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generates a structured approval matrix by traversing a user’s managerial chain for the specified number of levels (e.g., their manager, manager’s manager, etc.).
This avoids hardcoding approval paths — making approvals dynamic and maintainable.
⚙️ Inputs
Name Type Description
user_sys_id String Sys ID of the starting user
levels Integer Number of manager levels to retrieve (e.g., 3 = manager → director → VP)
🧾 Output
Name Type Description
approval_matrix JSON Array of { level, approver_sys_id, approver_name, approver_email }
Scenario:
A flow runs when an “Expense Request” is submitted.
Instead of assigning approvals manually, this Flow Action:
Takes the requester’s Sys ID.
Retrieves their manager hierarchy up to 3 levels.
Dynamically generates approvals (e.g., Manager → Department Head → Director).
Flow setup example:
Trigger: New Expense Request submitted.
Action: Generate Approval Matrix (input: current.user.sys_id, levels = 3).
Loop: For each approver in matrix → Create approval record.
Result: Fully dynamic, hierarchy-based approval flow.
🧩 Key Benefits
🔁 No hardcoding — adapts to real org chart changes.
🧱 Reusable across multiple approval workflows.
🧮 Supports configurable depth (1–N levels).
🧼 Self-contained — no external tables or integrations.