You are viewing limited content. For full access, please sign in.

Question

Question

Provide form for multiple approvers.

asked on May 23, 2017

Good morning,

I'm trying to find the best way to implement the following task:

To have one form where the customer can add multiple approvers and all added approvers have to approve. 

For simplicity purposes, let's say that I have one form with one Laserfiche Table field for email address. I add two fields, and input an email address in each. On submit, the form goes to an approval process.

Typically two approvers can get the form, and whomever approves it first, then the other doesn't have to. How can I make it so that both approvers have to approve the form, before moving to the next process. Keep in mind that there won't be a fixed number of approvers, so User Tasks can't be predefined in the Business Process, since the number of User Tasks would be unknown.

I was thinking in using Workflow to somehow restart the Business Process or something; but at this point I really don't know what direction to take.

Any suggestions/ideas?

0 0

Answer

SELECTED ANSWER
replied on May 24, 2017

Yeah that was my initial design but now you said the approvers are defined by a field in table (Forms table field right?), I got another idea:

In Forms, let's name the table field ListOfApprover and the field in it Column 1; add a single line field NextApprover, with formula "=INDEX(ListOfApprover.Column_1,1)" so it by default has value for first approver; add a number field LoopCount with value 1. This number field will be used to get next approver in workflow.

In Workflow:

Create a new number token named TotalCount and its value set to %(RetrieveBusinessProcessVariables_ListOfApprover\Column_1#@Count@#);

Condition for Branch 3 is LoopCount < TotalCount, so it should get next approver;

In token calculator, set token name LoopCountPlus = %(RetrieveBusinessProcessVariables_LoopCount) + 1;

Then assign token NextApprover with value %(RetrieveBusinessProcessVariables_ListOfApprover\Column_1#[%(TokenCalculator_LoopCountPlus)]#)

And set NextApprover and LoopCount (with LoopCountPlus) back to forms.

In Branch 4, simply set NextApprover to empty.

In this way the range does not matter, but you'd better keep the Table column field required so there is no empty field during the loop, which would stop the loop.

2 0

Replies

replied on May 23, 2017

See https://answers.laserfiche.com/questions/91914/Multiple-User-Approval-in-Forms-10https://answers.laserfiche.com/questions/120951/Forms--Assign-a-task-to-a-team-of-people-who-approve-and-that-everyone-can-approve

You can assign user task to a field value, and use Workflow service task to update field value to next approver, and loop back to user task and Workflow service, something like this:

0 0
replied on May 24, 2017 Show version history

Rui, thanks. This seems promising.

I'm putting together the Workflow, but I see that you have a fixed number of Apprvers (Approver1 and Approver2).

In our case, the customer will add multiple approvers, it could range from 1 - 5, but we don't know. This will be done via a Laserfiche Table field.

I imagine that since I know the range, I could simply take your suggestion and add 3 more approvers, and then check if they exist or not? Am I in the right direction?

0 0
SELECTED ANSWER
replied on May 24, 2017

Yeah that was my initial design but now you said the approvers are defined by a field in table (Forms table field right?), I got another idea:

In Forms, let's name the table field ListOfApprover and the field in it Column 1; add a single line field NextApprover, with formula "=INDEX(ListOfApprover.Column_1,1)" so it by default has value for first approver; add a number field LoopCount with value 1. This number field will be used to get next approver in workflow.

In Workflow:

Create a new number token named TotalCount and its value set to %(RetrieveBusinessProcessVariables_ListOfApprover\Column_1#@Count@#);

Condition for Branch 3 is LoopCount < TotalCount, so it should get next approver;

In token calculator, set token name LoopCountPlus = %(RetrieveBusinessProcessVariables_LoopCount) + 1;

Then assign token NextApprover with value %(RetrieveBusinessProcessVariables_ListOfApprover\Column_1#[%(TokenCalculator_LoopCountPlus)]#)

And set NextApprover and LoopCount (with LoopCountPlus) back to forms.

In Branch 4, simply set NextApprover to empty.

In this way the range does not matter, but you'd better keep the Table column field required so there is no empty field during the loop, which would stop the loop.

2 0
replied on May 25, 2017 Show version history

Hi Rui. Thanks for the really detailed step by step process; I really appreciate it.

I have screenshots of what I currently have in place, following your strategy step by step.

I'm testing with a 2-approver case, and I noticed that I'm only getting one email message.

In WF I added an Email Activity in both branches to see which branch was kicking in and noticed that I'm getting the email message from the second branch only. 

In Forms, at the "Instance-->Variables" screen I see the LoopCount as 1.

In the form I'm using two different email addresses. Can you take a quick look at all my screens and see if I missed anything?

Thank you for taking me by the hand on this. I really appreciate the effort.

FirstBranch.png
ProcessDiagram.png
TotalCount.png
WF.png
WFTaskFromInstanceScreen.png
Form.png
TotalCount.png (6.46 KB)
WF.png (16.87 KB)
Form.png (17.39 KB)
0 0
replied on May 25, 2017 Show version history

UPDATE: Rui, I had a semicolon at the end of two activities. I removed them and now the process seems to be going into the first branch first. After the first approver submits the form it seems to Ending (without errors) though, but at least you got us this far. I'll keep trying.

WFTaskFromInstanceScreen.png
ProcessHist.png
ProcessHist.png (31.51 KB)
0 0
replied on May 25, 2017

Rui, for me the Process Diagram was running on its own at the Workflow Service Task. It was just getting caught in a look for some reason, even though I was checking for empty Approvers. What ended up working form me was the Process Diagram in the image attached.

The Workflow worked for me, right out of the box. Thank you!

Thanks again for sharing your strategy.

WorkedProcess.png
1 0
replied on May 25, 2017

With your process diagram, it would not loop back until user task gets approved, so the tasks would be assigned one by one instead of in parallel.

And for the previous post, the "NextApprover" seemed to have wrong value "2", while it should have value for next approver.

But since you said it's working then I guess you have fixed it.

0 0
replied on May 26, 2017

You are right all the way, yes. I had to fix all those issues. I guess I was just looking at it too much and needed to step back. 

Having the approvers approve one at a time is what we want for now, but I'm sure it will pop up in other projects where we'll want otherwise and you provided a great resource for that as well.

Thanks again Rui, 

Raul

0 0
replied on June 19, 2020

Hi @████████

Followed your step by step process and it works great!

We have added that each approver can add optional comments and their signature (required) to a user task form using a collection, the final form is sent to WF doing an update word doc activity but the signature image does not come through in a table merge.

Do you have any suggestion on how to capture the approver's comments and signature?

Secondly, when any approver rejects the form, the form is routed back to the submitter to make corrections and should go back through the approval process starting with the first approver, but the approver loop takes it the next approver. How do I get it to start all over again? Does that make sense?

Appreciate any insight.

Thank you,

Jo Anne

On Forms 10.4.0, WF 10.2.0

 

0 0
replied on June 21, 2020

Hi @████████

1. For signature field, Forms sent the data to Workflow in base64 encoded format, you need to generate image out of the base64 string in Workflow. A similiar reference is https://answers.laserfiche.com/questions/66791/Workflow--Copy-Signature-into-PDF

2. If you want to reset the approver, you could add another Workflow to set the LoopCount back to 1 and set the NextApprover to the first approver, then loop back to the user task.

0 0
replied on June 21, 2020

Thank you @████████ for your help!

Will check out the reference on the signature and give it a try.

For the reset, I am fairly new to WF, how would that WF look like and where to place in form process diagram?

process diagram:

0 0
replied on June 23, 2020

The WF should have a "Set Business Process Variable" which sets the form variable LoopCount and NextApprover to initial value.

And place it after "Revise Form" or "Notification from sent to upper mgmnt (1)", before the gateway for loop.

0 0
replied on June 24, 2020

Thank you @████████- will give it a try!

0 0
replied on September 20, 2019

Raul,

 

We are trying to get the same thing achieved. We have a travel form as well as other forms, that depending on the user may have to go through several approvers.  We would like to get this list by using workflow to query our active directory.  Can you show me how you configured the workflow in your example, as well as the 2 approver user tasks (approver first & approver loop)?  I think we are stuck on this part. 

 

Thank you,

Amberly

0 0
replied on July 7, 2021

Thank you for this solution.  I was able to implement it and it works great.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.