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

Question

Question

Parallel approval routing based on the starting number in several account numbers

asked on March 13

I created a Travel Request Form. One of the approval steps is for budget approval. There are two people who can approve for budget, let's call them Jack and Jill. However, Jill only approves for *grant* account numbers, which start with 250, 251, 252, and 410. Any non-grant accounts need to be approved by Jack. There are several 'account number' fields on this form (for airfare, hotel, car rental, shuttle, parking, per diem...). In fact, any one of these (airfare...) can be split among 2 account numbers. It's possible that both Jack and Jill will both have to approve, and I'd like it to happen simultaneously. 

I have a hidden field to determine who needs to sign. I'm working on the calculation on this field, but realizing my calculation will only work if only 1 of them need to approve. Plus, it would be nice to just put the 250, 251, 252, 410 in an array, and check each account number variable against that array.

=IF(
OR(
    LEFT(Airfare_Acct_No_1,3)="250",
    LEFT(Airfare_Acct_No_1,3)="251",
    LEFT(Airfare_Acct_No_1,3)="252",
    LEFT(Airfare_Acct_No_1,3)="410",
    LEFT(Airfare_Acct_No_2,3)="250",
    LEFT(Airfare_Acct_No_2,3)="251",
    LEFT(Airfare_Acct_No_2,3)="252",
    LEFT(Airfare_Acct_No_2,3)="410",
    LEFT(Car_Rental_Acct_No_1,3)="250",
    LEFT(Car_Rental_Acct_No_1,3)="251",
    LEFT(Car_Rental_Acct_No_1,3)="252",
    LEFT(Car_Rental_Acct_No_1,3)="410",
    ...
),"Jill","Jack")

Any suggestions?

Laserfiche Forms process diagram segment.PNG
0 0

Replies

replied on March 14 Show version history

Have you thought about splitting it up into 2 decisions?  One if Jill needs to approve and one if Jack needs to approve.

DualApproval.png
DualApproval.png (15.37 KB)
1 0
replied on March 14 Show version history

Be careful with your use of splitting gateways then merging gateways. Your first idea won't work because you use an inclusive gateway to split (0 or many paths taken), but you use a parallel gateway to merge (waits for all inflows). If only 1 approver has to approve, the parallel gateway on the backend will still wait for the other branch. You need to use an inclusive gateway to merge so that it will only wait for active branches. 

As for your logic, you need to check separately if Jack needs to approve or if Jill needs to approve. One idea is to have two hidden fields "Jack Required?" and "Jill Required?" (or something like that). You could use your if statement to run through each account number and if it starts with one of those values, put "Yes" in the Jill Required? field. You should then check the account numbers again with an AND comparison to see if they ALL start with those numbers. If they all start with those numbers, Jack is not needed, otherwise put a Yes in Jack Required? as well. 

Now that you have two fields with Yes or No in them, you can use that as your inclusive gateway conditions. If( JackReq = yes) take the Jack approval path, if( JillReq = yes) take the Jill path. Since you are using an inclusive gateway, you can have one or both paths followed. Make sure to merge with an inclusive gateway also so that whether 1 or 2 branches are followed, the gateway will wait appropriately. 

1 0
replied one day ago

Thanks for the replies. Both were a big help!

I added 2 hidden fields: Grant_Budget_Approval_Required and Non_Grant_Budget_Approval_Required. 

I thought I could just use the OR function to check for grant account numbers (those that start with 250, 251, 252, or 410). However, not all account number fields will have a value entered into them, and I don't want to set a default value on them. The OR function fails every time one of the fields doesn't have a value. 

Is there a different function I should be using, instead of OR()?

Here's my calculation for the Grant_Budget_Approval_Required field:

=OR(LEFT(Airfare_Acct_No_1,3)="250", 
LEFT(Airfare_Acct_No_1,3)="251",
LEFT(Airfare_Acct_No_1,3)="252",
LEFT(Airfare_Acct_No_1,3)="410",
LEFT(Airfare_Acct_No_2,3)="250",
LEFT(Airfare_Acct_No_2,3)="251",
LEFT(Airfare_Acct_No_2,3)="252",
LEFT(Airfare_Acct_No_2,3)="410",
LEFT(Per_Diem_Acct_No_1,3)="250",
LEFT(Per_Diem_Acct_No_1,3)="251",
LEFT(Per_Diem_Acct_No_1,3)="252",
LEFT(Per_Diem_Acct_No_1,3)="410",
LEFT(Per_Diem_Acct_No_2,3)="250",
LEFT(Per_Diem_Acct_No_2,3)="251",
LEFT(Per_Diem_Acct_No_2,3)="252",
LEFT(Per_Diem_Acct_No_2,3)="410",
LEFT(Registration_Acct_No_1,3)="250",
LEFT(Registration_Acct_No_1,3)="251",
LEFT(Registration_Acct_No_1,3)="252",
LEFT(Registration_Acct_No_1,3)="410",
LEFT(Registration_Acct_No_2,3)="250",
LEFT(Registration_Acct_No_2,3)="251",
LEFT(Registration_Acct_No_2,3)="252",
LEFT(Registration_Acct_No_2,3)="410",
LEFT(Taxi_Acct_No_1,3)="250",
LEFT(Taxi_Acct_No_1,3)="251",
LEFT(Taxi_Acct_No_1,3)="252",
LEFT(Taxi_Acct_No_1,3)="410",
LEFT(Taxi_Acct_No_2,3)="250",
LEFT(Taxi_Acct_No_2,3)="251",
LEFT(Taxi_Acct_No_2,3)="252",
LEFT(Taxi_Acct_No_2,3)="410",
LEFT(Car_Rental_Acct_No_1,3)="250",
LEFT(Car_Rental_Acct_No_1,3)="251",
LEFT(Car_Rental_Acct_No_1,3)="252",
LEFT(Car_Rental_Acct_No_1,3)="410",
LEFT(Car_Rental_Acct_No_2,3)="250",
LEFT(Car_Rental_Acct_No_2,3)="251",
LEFT(Car_Rental_Acct_No_2,3)="252",
LEFT(Car_Rental_Acct_No_2,3)="410",
LEFT(Parking_Acct_No_1,3)="250",
LEFT(Parking_Acct_No_1,3)="251",
LEFT(Parking_Acct_No_1,3)="252",
LEFT(Parking_Acct_No_1,3)="410",
LEFT(Parking_Acct_No_2,3)="250",
LEFT(Parking_Acct_No_2,3)="251",
LEFT(Parking_Acct_No_2,3)="252",
LEFT(Parking_Acct_No_2,3)="410",
LEFT(Gas_Acct_No_1,3)="250",
LEFT(Gas_Acct_No_1,3)="251",
LEFT(Gas_Acct_No_1,3)="252",
LEFT(Gas_Acct_No_1,3)="410",
LEFT(Gas_Acct_No_2,3)="250",
LEFT(Gas_Acct_No_2,3)="251",
LEFT(Gas_Acct_No_2,3)="252",
LEFT(Gas_Acct_No_2,3)="410",
LEFT(Addl_PerDiem_AcctNo,3)="250",
LEFT(Addl_PerDiem_AcctNo,3)="251",
LEFT(Addl_PerDiem_AcctNo,3)="252",
LEFT(Addl_PerDiem_AcctNo,3)="410"
)

0 0
replied 19 hours ago

This is a long list of accounts.  Have you considered making a SQL table of the accounts and the approvals needed then pass the account number to workflow to make the decision and pass it back to the form?

 

You could make the table with columns for the account number, grant approval and non-grant approval.  The approval columns could be text fields with True or False values (not a bit type).

 

On the form, right before the decision you would pass to a workflow and make sure the form waits for the workflow to finish.  Workflow could use a for each loop to look up each account and modify tokens for true/false answers for each approval.  The workflow would then pass the true/false decisions back to the form and your decision can continue from there.

 

Putting the account numbers in a SQL table would also allow for future growth, for example if you needed to add a third approval.  Adding a third approval could add another column to the table and make the modification in the for each loop.  Or even if you just need at all more account numbers.  You would just need to update the table for the process to use the new numbers.

FormDecision.png
FormDecision.png (54.34 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.