Lagra Automations

Create List items from Nintex repeated section field

Using Nintex 2016 Form and SharePoint 2016, this article will show you how to create list items from a Nintex form repeating section.

Sample repeating section

This repeating section is stored in SharePoint as an XML as seen below:

<?xml version=”1.0″ encoding=”utf-8″?><RepeaterData><Version /><Items><Item><Task type=”System.String”>Change the light bulb</Task><Status type=”System.String”>New</Status></Item><Item><Task type=”System.String”>Clean the workshop</Task><Status type=”System.String”>In Progress</Status></Item><Item><Task type=”System.String”>Repair the door handle</Task><Status type=”System.String”>In Progress</Status></Item><Item><Task type=”System.String”>Clean the windows</Task><Status type=”System.String”>Completed</Status></Item></Items></RepeaterData>

Using Code Beautiful, it looks like the below:

From the above XML, let’s create new list items from the repeating section using Nintex Workflow.

Create Workflow Variables
  • Listitems – Type Collection – This will be used to store the XML gotten from the SharePoint list item.
  • TasksItem – Type Multiple Lines of text –  This will be used to store each line Item from the XML.
  • TaskIndex – Type Number – This will be used to store the index of each of the repeating section.
  • Task – Type – Single line of text – To store associating Task.
  • Status – Type – Single line of text – To store associating status.
Workflow Variables
Create Workflow Actions

For all images stipulated below use the numbers as guide to all the steps that should be taken.

  • Add a Query XML Action that queries the SharePoint list column and stores the output in the listitems collection variable. To understand this action better, you can explore this article.
First Query Action
  • Add a For Each Action that stores each item in the listitems collection variable into the TasksItem variable and stores the index into the TaskIndex variable.
For Each Image
  • Add a Qwery XML Action that queries the TasksItem Variable and stores the output for each section field name into their corresponding variables. i.e. Task field will be stored in Task variable and Status field should be stored in Status Variable.
Second Query XML

A BUG is usually generated here. This is because there would always be a default empty repeating table section. This then creates a line item regardless of if the repeating section is empty. 

To fix this bug, add the Run If action and configure it as below:

Run action only if the Task variable is empty and the TaskIndex variable is 0. The action to add in the RUN IF action is an END workflow action. 

Run IF action
  • Add a Create Item Action to create the fields in the SharePoint list.
Create Item Action
  • The workflow should look like the below image.
Complete Workflow

Leave a Reply

Your email address will not be published. Required fields are marked *