cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting Repeating Section Data into Document Creation

Hi,

One of my workflows I am trying to build revolves around extracting XML data from a Nintex Form Repeating Section and then updating a document (table) with the data.

I am getting stuck pulling and extracting the XML data in my workflow.

Currently this is what I have....

  1. Define DOCX template location
  2. Define PDF location URL
  3. Repeating Section XML > Variable : MLOT_XMLDump
  4. String : Clean up XML > MLOT_XMLDump : fn-XmlDecode({WorkflowVariable:MLOT_XMLDump})
  5. Set Index to 1
  6. Query Variable MLOT_XMLDump and store all data in a collection variable called col_Items
  7. Run  For Each
    1. Target collection = col_Items
    2. Store reult in MLOT_Items
    3. Index = Index
  8. Query each XML {WorkflowVariable:MLOT_Item} - Output each item e.g "//LineQty" using XPATH and store in variable called rpt_LineQty. I am doing this for each repeating section item (LineItem, LineCost, LineQty, LineTotal).
  9. Math operation at the end of the For each section to increase Index by 1

This is now where I am stuck. I am guessing that now I have all my Repeating Section Items stored in my variable (rpt_LineItem, rpt_LineQty,rpt_LineCost etc) but how do I then get this data updated into a document? Ideally I want to replicate the data as a table in a DOCX.

I have read through several different guides but I am getting totally confused and torn with different ways of doing this.

Am I on the right lines? If someone could help it would be appreciated

The workflow does work for basic list data and creates a new DOCX but it is the repeat section data that I am completely lost on.

I have added content controls for the repeating section variables in the "Update Document" Action...

31-03-2016 16-21-02.png

I have attached the Workflow for reference.

Thanks in advance

Labels: (3)
0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: Getting Repeating Section Data into Document Creation

Hello, Joe!

So, I'm a newbie to Nintex, so take my advice with a very large grain of salt - also, I had my data move into Word, not a table - I have not figured out the table stuff yet. (I was thinking HTML, but Word doesn't seem to know how to deal with HTML ... but I digress.)

I've recently put repeating data into a Word document, and the trick to getting in all sections (and not just the last piece it cycled through) is to ensue you merge your single line (rpt_LineItem), for example, back into itself.

What does this mean? First it means you need to define how you want to see your data and build your string, and a variable to associate to - for example, ctrlBlock. So, I set a condition in my loop that said: "if any value in this WorkFlow is equal to 1, then YES, if not, then NO"; YES leads to "First Instance" where the String is formed ie, "LINE ITEM: {rpt_LineItem}   AMOUNT: {rpt_Amount} etc".

If NO, then you go to a String where it's "LINE ITEM: {rpt_LineItem}   AMOUNT: {rpt_Amount} etc" {commNewLine} {ctrlBlock}"

This compiles your block of text by putting the indexed string on top of itself repeatedly, and the condition makes it so the very first line is just by itself (since there is no other index data at the point). Then, all you need do is drop the block into your Word doc.

Again, not a table, but maybe this will help you figure out a way to do that...  and let me know if you, or anyone else, does.

Cheers!

Rhia

0 Kudos
Reply
clxwas3
Nintex Newbie

Re: Getting Repeating Section Data into Document Creation

Hi, Joe!

Do you solved this problem? I just want to have this function...

Thanks.

0 Kudos
Reply
marcof
Nintex Newbie

Re: Getting Repeating Section Data into Document Creation

I have the same problem!

0 Kudos
Reply