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

Question

Question

Attach Electronic Document activity not seeing For Each Row output

asked on February 12, 2018

Hello everyone.  Looked for other posts on this but haven't run across anything that resembles my issue.

I have been trying every angle to get this to work, but stuck at every attempt.  I have an issue where I cannot get the Attach Electronic Document activity to "see" the Update Word Document activity I have embedded inside a For Each Row activity.

I am using the For Each Row to pull data from a Forms entry.  The Word document has a table merge and a simple merge inside of it.  The Table is named in the doc.   If the Update Word activity is inside the loop, Attach Electronic Document doesn't recognize it.  If I take it out of the loop, it can access it.

Steps

1. Get form variables.  There is a collection as well as other single value variables.

2/3.  Loop goes through to record the entries of the collection.  This works fine.

4.  Target collection in For Each Row.

5.  Update Word doc from Server Attachment.  There is a table merge set for the collection and a simple merge for the other fields.

6.  Create entry for the attachment.

7.  Attach updated doc to the newly created entry.

 

The problem is that I cannot get the Attach to recognize the Update activity.  I have tried every which way to configure it, but nothing works.  Can someone see where I am going wrong?  Using Activity as the source yields nothing.  Thank you in advance !!

0 0

Answer

SELECTED ANSWER
replied on February 12, 2018

This is expected behavior. Tokens and files generated in a loop (For Each Row, Repeat, For Each Entry, etc) go out of scope after the loop ends because it's not possible for Workflow to guess which iteration's value you need to use.

That said, I'm not sure I understand why you use "For Each Row-WordUpdate". A table merge in Update Word Document adds all rows in one step, it does not require adding them one by one.

1 0
replied on February 21, 2018

Hi Miruna.  Could you please look at the behavior I am seeing from the table merge below?  My excel sheet updates correctly with the form collection data, however, when it fills in the Word document, it isn't pulling the collection entries from the beginning of the collection.

Even if I simplify the document to just have the table merge fields, it is only filling in one row, but mixing data from the rows.  Example below.  I have gone over this form and workflows and I cannot see where it is all going wrong.

Thank you.

0 0
replied on February 21, 2018

Nevermind.  Right after posting this I noticed there was a hidden NEXT mergefield in the beginning of the row.  I couldn't see it until I did ALT + F9 to reveal all merge codes.

0 0

Replies

You are not allowed to reply in this post.
replied on February 14, 2018 Show version history

Thank you Miruna for the explanation.  I kept seeing reference to people needing to use the For Each Row to access the BP Form collection variables.  But if the table merge feature pulls entries in the collection automatically, then that makes sense.

-/

**Ok.  I tried setting it up that way, but the Table Merge still doesn't pull multiple entries.

In this example I had two entries in the collection.  The saved form receipt(1) showed how they were entered, but the Word document(2) was filled in both incorrectly and incompletely.

The strange part of it is that I have part of the workflow that uses a for next row to step through the Retrieve BP Variables and save to a spreadsheet.  That works fine, so I know it captured the collection data correctly.

If there something I am missing on the table merge portion?  Screen shot of the merge codes are at the bottom of this marked (3).  (4) and (5) are from the Update Word activity in Workflow.

Thank you for your help!

 

1> This was the form entry saved to LF (all of this is test data):

 

2>  Completed word document example:

3> Word merge codes:

4> Simple field merge:


5> Table merge:


 

You are not allowed to follow up in this post.

Sign in to reply to this post.