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

Question

Question

Forms- Routing Decision if Amount in Collection is less than or greater than specified amount

asked on April 2, 2021

We have a form that has a collection (can add up to 10 invoices in one form submission) and we are trying to format the gateway with this logic: if any of the amounts in the collection is <1000, then route to the approved email step but if it is =>1000, then route to the VP Approval step. The below screenshot shows how we have this set up and it works correctly if only one invoice is submitted in the form, however, if multiple invoices are submitted, the workflow terminates for some reason. How can I get this to work? "AP" is the name of the collection.

 

0 0

Replies

replied on April 5, 2021

Hi Jorge, It likely terminates as the value is a accumulation of the Collections fields (ie:1000,800,1100, etc) and as such does not meet either of the gateway logic.

I would recommend you create another Number field outside of the collection (ie: VoucherLimit) with a calculation that would find the smallest value in the collection
(ie: =IF((MIN(Voucher_Amount_))<1000,"LESS","MORE").
This will give you the answer as to whether any of the Voucher values is less than a 1000.

You could then use this value in your gateway logic, 

dataset/VoucherLimit="LESS"

dataset/VoucherLimit="MORE"

*As a best practice I always set the last path as the default path instead of a condition. What this will do is if the conditions above is not followed, it falls through the list, and at the last will follow that path as opposed to failing as all conditions were not true. Saves the headache of Terminated Workflows

0 0
replied on April 12, 2021

Hi Steve,

 

Thanks for this info on how to accomplish this. As suggested, I am trying that calculation on a new field (VoucherLimit) outside of the collection, but get this error. I also get this error when replacing Voucher Amount to inlcude its collection (AP.Voucher_Amount). I have verified that is the variable name so not sure what LF forms doesn't like.

 

 

Please advise.

0 0
replied on April 13, 2021

Hi Jorge

Your Voucher_Amout_ variable should look like CollectionName.VariableName. Use the token picker to change the Voucher_Amount_ token to the Collection Token name in the formula.

In the end, it should look similar to

=IF((MIN(CollectionName.Voucher_Amount_))<1000,"LESS","MORE")

 

0 0
replied on April 13, 2021

Seems to be something else it doesn't like. I added it using the token picker. 

0 0
replied on April 13, 2021

You are missing the closing bracket ")" on the end of the formula

=IF((MIN(CollectionName.Voucher_Amount_))<1000,"LESS","MORE")

1 0
replied on May 17, 2021

Thank you. This worked!

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

Sign in to reply to this post.