Approval flow - no record found issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 03:14 AM - edited 10-07-2024 03:18 AM
Hi
How can I prevent a situation where look up record step runs, but at the time the flow executes, no record is found in the sysapproval_approver table? (flow runs in background by default, not foreground)
I have an "Approval" Service Activity step in HR Service that creates an approval task. However, it seems that the flow runs before the approval record is created, resulting in the error "No record found."
If I add a "Wait for a duration of time" step, say 5 seconds, the record gets created, and the look up step finds the approval records that were created by Service Activity step. As a result, the flow completes successfully.
Is there an alternative approach to prevent this issue, aside from using a fixed wait time?
Error when flow doesn't have wait for 5 sec step

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 05:26 AM
You can trigger this flow based on Approval Record.
You can set the trigger condition as Approval For.Task Type = HR to avoid running this flow for other records
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 05:38 AM - edited 10-07-2024 05:44 AM
Hi @palanikumar , thanks for you reply
the thing is, the flow needs to know that it should run not for all approval tasks (even if the task type is set to HR) but for the parent HR case that was created, for that approval.
So the update in the approval task has to be only for the parent case. That's why the flow trigger was set to HR case creation, not approval task creation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 07:35 AM
How will you decide a HR Case as parent or not?
1) HR Case is Parent if the HR case do not have any parent, then you can add trigger condition and can check whether <HR Case>.<parent> is blank.
2) HR Case is Parent if it has one more Child HR Case, then you need to add a step inside flow and Lookup for all HR Case records with parent as current HR Case. Exit if the count is zero
Palani