- 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:03 AM
Hi @santhoshini2 ,
Could you explain the use case more clearly so that we can help you ?
As your 1) task is understandable but 2) is not clear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 05:13 AM
Hi @shivatmika_19 ,
1. If anyone raises request approval should go to static approver (XYZ)
2. If static approver itself is the requestor, then approval should go to their manager.
I hope you got the requirement. Please let me know if you need more information.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 05:06 AM - edited ‎12-03-2024 05:07 AM
Ok strap in, because this needs absolutely ZERO code.
My sample is a service catalog and I'm looking for a requested_for of Abel Tutor.
If that's true I'm sending approval to Abel's manager, otherwise I'm sending to a fixed team.
How do we evaluate if the thing is for Abel Tutor? In this case we dot walk to the Triggering Record's Requested For.
Since we want to look for a specific user, we paste that user's sys_id into the value. No single quotes, this isn't a javascript string. Also, be a good steward of your flow and make sure you annotate who the specific user is, because interpreting and looking up sys_id's makes puppies sad.
Ok, so if that IF statement evaluates as true lets send to Abel Tutor's manager. Since the manager may change at any time OR we might change our mind about targeting a specific user, lets make this a rule based, rather than picking another specific approver. In the case of my RITM example, I'm grabbing the Trigger, RITM, Requested_For, Manager.
So now lets deal with the Else case. I don't know what you meant by XYZ, so I assumed a specific group.
So I used the group silhouette icon to select App Engine Admins
Tested with Abel Tutor, and it successfully went down the true path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 05:20 AM
Hi @Uncle Rob ,
Thank you for your response!
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.
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? If there's a more efficient way to streamline this process, I’d love to hear your suggestions!
Looking forward to your insights. Thank you for helping!