- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 04:28 AM
Hi Community,
I am currently working on a flow in Flow Designer that needs to dynamically assign approvers based on the requestor. The use case is as follows:
- If a specific user (e.g., "XYZ") raises a request, the approval should go to her manager.
- If anyone else raises a request, the approval should go to XYZ.
I’ve attempted to implement this using the "Ask for Approval" action, but I am struggling to configure the dynamic assignment of approvers using scripts.
Can anyone suggest the approach to achieve this functionality?
I appreciate any guidance or examples from the community to help me resolve this issue. Thanks in advance for your help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 10:57 PM
Hi @santhoshini2,
You can try this approach:
Inside if:
for this step you need to create flow variable from (...) of flow designer and give the type of the flow variable as reference and select User table
else case (when any user other than static user approval goes to static user)
The last step outside if's: Ask for approval:
Drag the flow variable to the rules.
Complete Flow:
Note: you need to handle a case where static user doesn't have any approver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 05:30 AM
I completely agree with you that by following this method, I would need to check the approval status twice to update the catalog tasks and RITMs. This adds additional steps to the process and might complicate the flow.
I don't understand what this means. You're not checking approval status twice, you're resolving an If and creating ONLY ONE of two different types of approval.
Is there any way we can achieve this functionality using a single "Ask for Approval" action while still dynamically determining the approvers based on the requestor?
You *could* script it, but in so doing you're eliminating two key benefits of the flow
- ease of troubleshooting
- ease of reading.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 10:57 PM
Hi @santhoshini2,
You can try this approach:
Inside if:
for this step you need to create flow variable from (...) of flow designer and give the type of the flow variable as reference and select User table
else case (when any user other than static user approval goes to static user)
The last step outside if's: Ask for approval:
Drag the flow variable to the rules.
Complete Flow:
Note: you need to handle a case where static user doesn't have any approver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 01:01 AM
Thank you so much for your help! @shivatmika_19
Your solution perfectly addresses my requirement, and I truly appreciate the time and effort you put into explaining it. It has not only resolved my issue but also helped me better understand the flow design process in ServiceNow.
Thanks again for your support and guidance—this community is amazing because of contributors like you! 😊