Best practice implementing a reject which then can be approve

smicloud
Tera Guru

I am implementing an approval for sc_task using flow to add the approval. 

 

I did an until-loop with the approval inside the loop. If the approval first is rejected and in the next run approved, the approval is returning approval state = rejected and, hence, I assume I cannot implement it like this. It's like the flow cannot find the new approval but reuse the first rejected one. 

 

What is the best way to implement the possibility to first reject the approval if the information from the user is not as needed and when the user has provided the additional information the fulfiller can approve. The providing information bit is not part of the scope for the questions, only the approval. 

 

You can see the design in the flow diagram. The second run when the approval is approved "If approved" checks the approval state of the approval and it still returns false and approval = rejected I can see in the flow execution: 

 

image001.png

 

In following image you can see that the sc_task gets rejected the second run of the approval:

image002.png

And this is the approval record which is approved which triggers the rejection above. A bit strange that the approval in the flow execution is rejected but approved in the audit log. Checking the audit log I can se that approval has been moved to "Requested" when the second approval is triggered: 

image001.png

 

So, either:

1. Why is this not working and how can I fix it? I couldn't find any business rule handling the move of state of the approval to rejected (neither any workflow).

or

2. What is the best way to implement an approval that can be first rejected n number of times and then approved. 

1 REPLY 1

smicloud
Tera Guru

It seems to be a bug in how flow is handling the approvals. The workaround is to add a lookup record action between 7 and 8 and check if the latest approval is approved. If not, assumed to be rejected (you can of course add if-else for other statuses if you'd like).