Hi all,
I want to create a Document Approval Workflow for Sharepoint. The requirement is, that when an approval instance has rejected, the approval request should go one step back to the approval instance before like approval instance 2 has rejected it should go back to instance 1.
It works for approval 3 to go back to 2 but it did not work for approval 2 to go back to approval 1. In this case the approval 2 instance got the request again.
I guess the "Do until" is not place correct?
The outcome of "Do until 2" is based on approval 3 and the outcome of "Do until 1" is based on the outcome of approval 2.
Any suggestions?
Could I suggest a slightly simpler design? Create two variables. The first is an array of Approver emails that you want to use. The second is an integer that records the Approval step to be processed and intialize it to 0. Then start a Do Until loop that will run until Approval step is greater than 3 or less than 0. In the Loop send an Approval to the approver in the array using the Approval step as an Index. When the response is returned increment the the Approval step if it was approved and decrement the step if it was rejected. Then loop. The Loop will continue until either the first person in the Loop rejects the approval or the last person in the Loop approves.
Hello @Pstork1,
thansk for your reply.
I´m not sure if I got this completely.
If I count the loop and have just one loop, how it is to suppose to just step one back?
E.g. if approval instance 3 has rejected it will not reach the value 3 and the loop will begin again at the top, or?
Here's a table that tracks through what a potential set of Loop runs would look like for the following Array of Approvers. "Approver1, Approver2, Approver3" with a starting value in Approval count of 0
Loop Number Count Is Count < 0 or >= 3 Approver Result Count after Response
1 0 No Approver1 Approved 1
2 1 No Approver2 Reject 0
3 0 No Approver1 Approved 1
4 1 No Approver2 Approved 2
5 2 No Approver3 Approved 3
6 3 Yes *** Loop Exits ***
User | Count |
---|---|
95 | |
40 | |
25 | |
22 | |
16 |
User | Count |
---|---|
130 | |
51 | |
48 | |
35 | |
24 |