Skip to main content

A customer recently reached out with a complex document generation scenario requiring a specific format for their repeating fields. They needed to pass a variety of variables including collections to a component workflow via a webhook and then generate a repeating table from this data.

 

The first thing we needed to do in this situation is to parse the data in the collection out into multiple collections, the amount of collections will depend on how many individual data points you want to pull from the initial collection.  In this case the customer parsed out 2 data points into two separate collections.

 

Now you might think that we could just generate the repeating table with the two collections.  Setting up your template for the repeating table like this.

 

25128iBACBE8A351B77131.jpg

This however did not give us the result we were looking for, the result looked something like this.  Which is obviously not how we wanted the table of data to look

 

25129iFFF8DCEE15D98222.jpg

 

After a little trial and error, we discovered that what we needed to do was use the merge collection action in the workflow to merge the multiple collections back into 1 object that we could use in the document generation.

 

The Merge collections action allows you to select the collections, data types and set a property name for each column of data we want to have and save into a new object variable. 

 

25130iE11C8081EA80D0DA.jpg

 

Now that we have the new object variable and collection, we are able to get setup the repeating data in the document generation action.

 

25131iB8C1D10C3BAF03EF.jpg

 

And this will give us the tags we need to place in the document generation template

 

25132iD2BE32FAFF61484B.jpg

 

Placing the tags into the table in the template will look like this now

 

25133i221DD2024E814C0A.jpg

Now when we generate the document the table will generate correctly and look something like this

 

25134iFCC67C4DFAC0C4BD.jpg

 

Note: during my testing I did not sort the data in the collection to order the numbers correctly as I knew this was possible to do and I was more concerned in getting the data to generate into the repeating table correctly.

 

Be the first to reply!

Reply