I want to export data from list to an Excel file, but I have repeating section in the form, and it just export all the xml code into the Excel file, How can I export clean output to the Excel file?
Solved! Go to Solution.
Sal,
By any chance are you using Nintex for Office 365? If so, please check out the new Document Generation feature:
Using Document Generation to create Excel Report from List Items
If not, check out Vadim Tabakman​'s blog on how to extract data from a repeating section. This includes a User Defined Action that you can download and use in your workflow that will extract the Repeating section XML into a text variable:
http://www.vadimtabakman.com/nintex-formsworkflow-parsing-repeating-section-data.aspx
You can then use some basic Nintex actions to convert the XML into a CSV text file, which can be easily opened with MS Excel.
Use the Query XML action to populate a collection variable for each repeating section field in the XML. Then use a For Each action to loop through the collections with a Build String action to format each row as a comma separated values and append each row to the output variable.
Next you'll need to use Powershell to save the CSV string into a CSV file. Here is a reference for how to call Powershell from Nintex Workflow:
NTX PowerShell Action - Stable Release
The PowerShell syntax to save a string to a text file is simple:
{WorkflowVariable:CSVData} > \\ServerName\ShareName\Metadata.csv