I’ve created a Nintex Form connected to a SharePoint list. The Nintex form contains a repeating section that is connected to a multiple lines of text field in the SharePoint list.
I have a Power Automate workflow that creates a PDF file based on information stored in the list item. I’ve got the PDF working well except for the repeating table section.
Does anyone know of any resources/videos that cover this specific part of Nintex for SharePoint? I am self-taught, and this is definitely a gap in my knowledge!
Page 1 / 1
Hi @sandra_mcg
i will be honest I have never come across this scenario before but it is definitely interesting, obviously this is a native capability of the document generation inside of Nintex workflow, I am not sure if you have this available to you as it might be a better option.
As the data in a repeating section is stored as XML you will have to parse it for use then place it in a html table to then place that in the template you are using.
Parse XML Data • To convert XML to a table in Power Automate, first, you need to parse the XML data. There’s a Power Automate action called Parse XML which is used for this purpose. • In your flow, add the action Parse XML. In the Content field, input your XML data. You’ll need to create an XML schema to match your XML data. You can use any number of online tools to generate this schema.
Initialise an Array Variable • After parsing the XML, the next step would be to initialise an array variable that will hold the table data. • Add an action called Initialise variable. Name the variable something like TableData, and select Array as its type. Populate the Array with XML Data • Now, loop through each item in your parsed XML using a Apply to each action. Inside this loop, use the Append to array variable action to add each item to your TableData variable. Convert Array to HTML Table • You can convert the array to an HTML table using the Create HTML table action in Power Automate. • Set the From field to the TableData variable. If you want to customise the table columns, you can use the Columns field, otherwise leave it as automatic. Insert the table into your document • Use the Populate a Microsoft Word template action and map the HTML table content to the content control in your Word template.
Think I’ve fallen at the first hurdle. :)
Parse XML Data • To convert XML to a table in Power Automate, first, you need to parse the XML data. There’s a Power Automate action called Parse XML which is used for this purpose.
• In your flow, add the action Parse XML. In the Content field, input your XML data. You’ll need to create an XML schema to match your XML data. You can use any number of online tools to generate this schema.
I couldn’t find a Parse XML action in Power Automate, but I can do a xml() expression in a Compose action. But I don’t know what is meant by create an XML schema. I’ll do some more googling and see what I can find. Thanks for your help!
New Question: the SPO list has a lookup to another list, and most of the information in the PDF comes from that other list. Is that something a Nintex Workflow would be able to manage?
Hi @sandra_mcg
Apologies, it has been a long time since I used power automate extensively, I think the parseXML is now a part of the compose action as you said, It should look something like this:
Keep in mind this will only gather one set of field data at a time, you will need to parallel compose actions for each field with different paths.
An alternate option would be to gather the XML data and change it into JSON which is much easier to iterate however I think this requires a premium 3rd party connector or an azure function.
To answer your further question, Yes, both creating a table for use in a document and referencing lookup data is very easy in Nintex workflow, Do you have access to Nintex workflow? If so I would happily show you how do this.
Kind regards
Jake
Thank you so much! I do have Nintex Workflow in my collection, but I am much less familiar with it, so would like to use Power Automate if possible (just thinking in terms of needing to make any future changes, etc). I’ll look more into this Parse XML stuff, see what I can work out!
No trouble at all @sandra_mcg, let me know how you get on and if you would like to see how this can be done using Nintex the offer stands, just let me know and we can book a time to meet.