In my previous post Exporting InfoPath repeating table data with Nintex Workflow I talked about how to pull repeating data from an InfoPath form for use in a Nintex workflow. You’ll want to read it first to understand where these steps fit. The client want the repeating data exported in the previous post to be displayed in table format in an approver email. I added a few steps before, during and after the For Each loop to build the HTML statement used in the body of the email.
BEFORE THE LOOP
Add a Build string action to the workflow before the loop.
Add a variable called LineDetailTable of type Single line of text. Configure the action as follows:
DURING THE LOOP
Within the loop, after the XML has been queried, add a Build string action to add the HTML for each of the repeating lines from the InfoPath form.
Configure the action to append the line details to the LineDetailTable variable:
AFTER THE LOOP
After the loop has completed, and the data from all the repeating lines has been added to the string variable, finish off the table in another Build string action.
In this case I included the Line Items table within another table that contained header information about the form. I controlled the font within both tables using styles.
DISPLAY LINE DETAILS TABLE IN AN EMAIL
I was able to display the HTML table in an email simply by inserting the workflow variable into the body of the email.
The table rendered in the email like this:
6 thoughts on “Creating an HTML table in a Nintex Workflow”
HI Great post!!
Ive been trying to get this to work not sure what I am missing, pretty sure I have missed something even though i have double checked everything!!
So I end up with either of two senarios:
Example 4 lines of data: If I configure my XML data extracts in the loop to save as single line of text, I end up with a table in my email with 4 rows of data, but same data from row one just repeats across the rest of the table.
If I set my XML data extracts up to save as a collection I then end up with 4 rows of data in my table, but each cell displays the total data from that collection. ie
Any help would be appreciated!!
Check the comments at the end of this post http://thedataqueenblog.azurewebsites.net/2013/05/exporting-infopath-repeating-table-data-with-nintex-workflow/ . Are you storing your results in a Collection type variable, and then looping through to put each one into a Single Line of Text? If you are not using a Collection variable you will run into your first scenario of 4 identical lines of data.
I have this working with a rollup of weekly reports, but I’m having issues with the HTML data displaying inconsistently. I suspect it’s a Nintex/MS Outlook issue, since it works OK most of the time. Other times there is stray code thrown in (i.e.; ) or the columns occasionally don’t display on one line. etc.
Have you had any issues, or have any suggestions?
I had issues with this when I first started configuring the HTML for email. You really have to be careful configuring the HTML body, font and table(s). You also have to be careful not to add any spaces or carriage returns into the ‘build string’ configurations. It should be one long string with no spaces.
Can you get this table to display on the workflow task or only on the notification email? When I try to put it in a rich text field all I get is the markup language not a table. How do you get HTML to show on the nintex forms?
You can only get the table in the notification email. I haven’t worked with nintex forms much.