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

Question

Question

Generate Word docs from a variable number of entries

asked on December 15, 2016

Ok, so I hope I can explain this well. I am trying to create a Business Process, that allows the user to:

 

Fill in a form, that has a variable number of rows with the following columns.

- Name
- Position title
-  email

 

So lets say submission1 = 2 people
submission2 may have 6 people, and so on.

My process with take that start form and trigger a Workflow Service Task.

 

The goal of my workflow is to :

- Retrieve the variables ( this works  )
-- For each contact submitted ( much like a mail merge )
- Update a Word Doc per contact submitted. ( it only merges the first contact, and repeats that )
i.e 2 contacts.. 2 documents
6 contacts submitted, 6 word docs generated
-- then I email ALL the documents as an attachment to 1 user ( this works )

The problem I am having in the workflow is, looping through the variables and trying to get them out into the Update word activity.

I have the Find/Replace fields working correctly. If I submit 1 contact through it works perfect.

How can I have it handle more than 1 correctly ? I tried For Each Value activity.. but I feel like it wont carry through multiple variables.  i.e name, title, email., and still keep track of which row

Capture.PNG
Capture.PNG (59.53 KB)
0 0

Answer

SELECTED ANSWER
replied on December 15, 2016

For Each Value provides an "iteration" counter which you can use to index the other variables to get them all to be from the same row.

1 0
replied on December 19, 2016

Brilliant  Miruna !  worked perfect... I have each row of variables merged in now and the info is consistent. On to my next issue :)

 

 

0 0

Replies

replied on December 15, 2016

In the For Loop

Create an Entry, Update Word Doc and then Attach Doc where you Attach the Word Update Result to the Create Entry. This way you will create how ever many Word Documents as your Loop Requires.

You will then attach each of the Newly created Word Docs Entries to the Email.

1 0
replied on December 19, 2016

Thanks Steve, this totally makes sense for not spamming the user with an email per. Even in my testing, I have 3 or 4 emails per form submission

 

I'll give it a try

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

Sign in to reply to this post.