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

Question

Question

Repeat function in workflow with multi-value template fields

asked on June 23, 2020 Show version history

So I'm trying to perform a function in Workflow for partial or full payments on a purchase order. 

The user uses several multi-value field within the template to decide the payment type and several other fields for that particular payment.  If the user selects "Partial Payment" instead of "Full Payment" they are able to generate a voucher for the partial payment and workflow repeats itself waiting for the user to select the payment type again.  That all works fine. 

The problem is if they create 2 or more partial payments the data is the same data from the 1st payment every time.  I can't get it to display the new template data for the new payment.  I'm not getting the most current multi-value field data from the template.  

Do I need to create additional multi-value tokens?

Capture.JPG
Capture1.JPG
Capture2.JPG
Capture3.JPG
Capture4.JPG
Capture.JPG (23.3 KB)
Capture1.JPG (47.37 KB)
Capture3.JPG (59.62 KB)
Capture4.JPG (78.35 KB)
0 0

Replies

replied on June 24, 2020 Show version history

Based on your screenshot it looks like you have 6 multi-value fields on your template and those fields are all in the same field group.

Seems to me if you are trying to look at all the Invoice Payment Type values on that template to see how many of them are partial you would need to use a For Each Value loop not repeat.

You could retrieve all the values in the Invoice Payment Type field.  Then use those values in the for each loop.

If you are trying to use the repeat loop because you are waiting for them to change it from partial to another value it would have to be broken out into another workflow like Pieter suggests or the first wait would hold up everything else.

Note that if you are trying to apply metadata to something you can apply the index of the iteration.  This means that if the for each loop is on the 3 iteration, it will pull the third value from the field, etc.

I hope the screenshot helps give you an idea for a direction to go.

PullSelectFieldValue.jpg
1 0
replied on June 25, 2020 Show version history

Thanks Jennifer and Pieter!

More details....When the workflow starts there are no payments its just a request approved for payment.  There are no values in the Field Group containing the 6 multi-value fields in the template.  So at this stage we are waiting for the product to arrive along with the invoice for the product.

Once we get the product/invoice we want a user to go into the doc and add invoice info into the 6 multi-value fields.

The one field within the field group that triggers the wait condition is PaymentType.  If payment type is "full payment" then a voucher (FillOutPDF) is created and the workflow ends. 

Here's the issue:  If its a "partial payment" the same voucher is created as if it was a "full payment".   But instead of ending the workflow I need to repeat the same process again because additional payment(s) are needed to complete the purchase.  So if another payment is needed I need to collect the most current values from the field group to create the new voucher.  Repeat again if its "partial payment" or end the workflow if "full payment".      

The wait condition works fine its just the collecting of the most current values in the field group after the user adds new data within the field group.  

Any help would be great!  Thanks John

0 0
replied on June 23, 2020

You seem to always be retrieving the first set of values from your multi-value fields, so this works as designed. 

Workflow doesn't know which values have changed, so you'd have to match them all with existing vouchers or something similar to decide if you need to create a new voucher.

0 0
replied on June 23, 2020 Show version history

Right I just don’t know where to begin with this one. I have never used a multi-value field in the template before. Is the repeat function the right one?  What is used to reference the most recent fields?  The new fields are within the template that a user inputs data in the fields.  Thx for any help. John

0 0
replied on June 24, 2020

Hi John-

In the Retrieve Field values, be sure you are grabbing the first index from the end of the set, as shown in the picture below.

Regarding using the repeat loop, it's hard to say without seeing the entire workflow. Those of us that have used it for a while tend to make smaller workflow chunks/functions rather than using a lot of wait conditions. For example, the Repeat area could be pulled out into its own workflow with its own starting condition. However, that wouldn't necessarily be better than how you have it.

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

Sign in to reply to this post.