Approval flow - no record found issue

miro2
Mega Sage

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?

miro2_2-1728295585378.png


miro2_4-1728295602886.png

 

miro2_5-1728295632362.png

 

miro2_6-1728295649104.png


Error when flow doesn't have wait for 5 sec step

miro2_7-1728295744393.png

 

3 REPLIES 3

palanikumar
Giga Sage

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

Thank you,
Palani

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.

miro2_0-1728304900526.png

 

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

Thank you,
Palani