cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Repeating Section Data in List Views, The Easy Way!

aymanelhattab
Nintex Newbie
35 73 40.6K

Introduction

Repeating sections are very powerful if you want to create 1 to many relationships within your Nintex Forms. However, they come with some caveats when you need to parse, use and display the data stored within them. This blog post introduces you to the Repeating Section Control, explains the parsing issue in depth and explains some existing solutions that was created earlier by the Nintex community. At the end of the post, I will introduce you to a Custom Field Type that I created to help non-technical users quickly display the Repeating Sections Data in List Views without creating Workflows or getting their hands dirty with XML, XSLT or Java script.

So, what is the repeating section control?

Control.png

The repeating section control is basically a container, which means that any controls added in the repeating section in the design time will be replicated in the runtime when the end-user clicks to add a new row. The end-user can also click the “x” icon to remove rows. Using Repeating Sections in Nintex Forms, you can create dynamic forms allowing the end users filling out the form to enter multiple values for a single field on a form. This is useful when you are collecting data and you do not exactly know in the design time how many records need to be collected each time the form is filled out.

DesignTineRS.png

RunTineRS.png

With the Repeating Section control, you can achieve a 1 to many relationship within your forms. Here are some examples:

  • Multiple products within the same order.
  • Multiple destinations, flights and hotels within the same travel request.
  • Multiple days off (with different types) within the same leave request.

The Problem

Despite how useful and cool the control is, there is no way OOB to parse the repeating section data if you need to do something with it. Why would you do that? Here are some scenarios / use cases:

  1. Interacting with the repeating section data from a Workflow.
  2. Saving the Repeating section data in another list and hence creating a Master-Detail or a Parent-Child relationship between two lists.
  3. Displaying the repeating section data in SharePoint List Views.

Basically, when an end-user fills out a form and submits it to the underlying list, an XML representation of the entire form is saved in a hidden field called "FormData". If we have a repeating section within the form, its data is also XML serialized and stored within this hidden field.  If you need this data for one or more of the three scenarios above, you need to retrieve the value of this hidden field then query the XML to parse the repeating section data. Osama Mourad has written a very useful post around that, you can check it from here.

The Solution

Luckily, Vadim Tabakman wrote a very good post documenting a workaround he came up with to simplify the steps above. Basically, he created a UDA (User Defined Action) to extract the XML of the repeating section from the FormData field then he used the “Loop” workflow action to loop through each record in the repeating section using an incremental index. Using Vadim’s workaround, you can read the records the end-user filled in the Repeating Section and interact with them within the workflow.

What if you want to save this data to another list and hence create a Master-Detail relationship between two lists? Eric Harris has used Vadim’s workaround, added his magic and showed us in an excellent blog post how to do that.

What Vadim and Eric have done is all based on Nintex Workflows. What if you don’t have the Nintex Workflow Product? What if you just need to display the repeating section data in List Views and you don’t want to create a Workflow just for that? Enter The “Nintex Repeating Section Data” Field Type.

“Nintex Repeating Section Data” Field Type

The “Nintex Repeating Section Data” is a custom field type that I created in my free time to easily display the records of a repeating section in SharePoint List Views without the need of creating complex workflows. After you create your Nintex Form using the standard best practices for repeating sections, you only need to create a Column of type “Nintex Repeating Section Data”, enter the name of the Repeating Section you want to display in the field creation page, add it to any view and BOOM … The repeating section data is displayed in a neat table! All the heavy lifting is taken care of for you. Below are a few screenshots to help you understand the idea:

Here is the “Orders” list :

1.png

And here is the Ninext Form, it contains a Repeating Section called “Products”, note that I'm not connecting the repeating section to a column.

2.png

Now, I’ll create a Column of the new type “Nintex Repeating Section Data”. In the additional column settings, I will put in the name of the Repeating Section in the form.

3.png

Once the column is added to the view, here is what you are going to get :

5.png

Pretty cool, eh?

You can download the WSP for SharePoint 2013 from the attachments below. The SharePoint 2010 one will be released soon.

Update (Aug 13th, 2015): SharePoint 2010 Version is now available, you can download it from here.

Notes:

  • The “Nintex Repeating Section Data” Field Type for SharePoint 2013 was created in my free time and is NOT a Nintex product. If you have any feedback, please feel free to post it here or ping me on Twitter @AymanElHattab .
  • You can create as many columns based on the new custom field type as needed. For instance, If you have 3 repeating sections (Flights, Hotels and Events) in your travel request form, you can create 3 columns to display the repeating sections' records in your View. Just make sure not to connect your Repeating Sections to list columns (as shown in the screenshots above)
  • IE7+, Chrome (Latest) and Firefox (Latest) are supported.
  • Nested Repeating Sections are not supported (yet).
73 Comments
fhunth
Nintex Newbie

Excellent resource.

Not applicable

This is a great article!!! We had few nightmares with repeating section. I am sure this article gonna end them soon

jordan_deroubai
Nintex Newbie

Awesome ! Thank you for sharing (I will wait the 2010 version)

jasongci
Nintex Newbie

Thank you.  Just what I was looking for. :-)

aymanelhattab
Nintex Newbie

Thanks! Coming in 1 week max.

aymanelhattab
Nintex Newbie

Thanks .. Glad you liked it

glenda
Nintex Newbie

Great! No more loops and other different actions!

aymanelhattab
Nintex Newbie

Thanks Glenda, have you tested it already?

omourad
Nintex Newbie

Great Job Ayman!

Have you tried the JSLink instead of a custom column? this can enable the end user customize how the data looks like in the list. also this way it can work in O365.

aymanelhattab
Nintex Newbie

Hi Osama,

Well, I wanted to create something that works for both SP2010 and SP2013, so Custom Field Type was my only choice.

If you want to further customize how the repeating section is renderes, the WSP creates a folder under Layouts called "NintexRepeatingSectionView", this folder contains two files:

- GetRepeatingSections.js --> This is the file which is referred to from the XSLT of the custom field type.  It does all the heavy lifting like querying the FormData hidden field, reading its XML to retrieve the specific repeating section the end user chose while creating the column, parsing the repeating section XML and extracting its records. It is also responsible for rendering the values in a table.

NintexRepeatingSection.css --> This is the css file used within GetRepeationSections.js to style the table.

As you can see, you have full control over both if you want to customize how the repeating section records are rendered. Not as powerful as JSLink, but works on any view and most importantly works for both SP2010 and SP2013. Next weekend, I will just change the mapping from [15] to [14] and hence have a working version of the WSP for SharePoint 2010.

I will definitely consider JSLink for Office 365, it's obviously the only option for me

Thanks,

Ayman El-Hattab

omourad
Nintex Newbie

Great, thanks for the information!

aymanelhattab
Nintex Newbie

The SharePoint 2010 version has been released ..

The "Nintex Repeating Section Data" Field Type for SharePoint 2010

jeepr92
Nintex Newbie

Getting an error when trying to deploy as a solution.  SP 2013

This solution contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'guid' failed validation, file manifest.xml, line 6, character 4: The element 'Solution' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'TemplateFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ActivationDependencies, FeatureManifests' in namespace 'http://schemas.microsoft.com/sharepoint/'.

aymanelhattab
Nintex Newbie

Hi Cory,

This is a farm solution, not a Sandbox one.

Ayman

jeepr92
Nintex Newbie

Since this is a farm solution.  What is the name of the feature to activate.  On my dev box i installed as farm solution but do not see it in my site collections features

aymanelhattab
Nintex Newbie

Hi Cory,

You don't need to activate any features. The custom field type is available for you to use once you deploy the WSP to your farm.

Ayman

stuart_landes
Nintex Newbie

This worked great!  Is there a similar solution if you need to print or provide reporting of some type?

aymanelhattab
Nintex Newbie

Can you please explain the use case in more details? If it's something of value, I can definitely implementat it.

stuart_landes
Nintex Newbie

Hmmmm.  I am new to Nintex so I will see if my vision makes sense.  I will be designing a form in the near future that will have a repeating section on it.  The client will want a printable (or exportable) version to send hard copy or email.  I tried to export a test and the column with the repeating section comes over blank.  Just wondering if including the repeating section is possible.

Thanks

aymanelhattab
Nintex Newbie

Hi Stuart,

Printing forms is coming soon as far as I know.

Ayman

c002928
Nintex Newbie

Any chance I could get the source code Visual Solution solution for this, also can it be modified to only be site collection scoped?

Not applicable

Hello

This looks great and it may help me out with my form that I have just created (I am only new at Nintex Forms).  Could you tell me where I need to save the .wsp file to on my SharePoint server so that I have the option to add the Nintex Repeating section data field type in columns?


Thanks

Nicole

aymanelhattab
Nintex Newbie

Hi Nicole Simpson, You need to deploy the WSP like any other WSP. Check this quick tutorial for more info.

aymanelhattab
Nintex Newbie

Hi Scott,

We're working now on Version 2 of the solution. Once published, feel free to reach out for the source code.

And no, it cannot be site collection scoped because it's not a feature.. That's a SharePoint limitation.

Ayman

omourad
Nintex Newbie

Here is the JSLink for the Repeating Section Nintex Repeating Section – JSLink

Not applicable

Hi

Thanks so much for this, it has been deployed and now I can add the repeating section data field in when I create new columns.

Thanks again

Nicole

stuart_landes
Nintex Newbie

Great!!!  Quick side question.  Is the metadata stored in repeating sections searchable?

c002928
Nintex Newbie

How do you control the order that the repeating section controls (columns) show up in the list view? I have a repeating section with a person control named AccountName and a calculated value control named DisplayName, no matter what order I add the controls to the repeating section the person control data (AccountName) is always on the left and the calculated value data (DisplayName) always appears on the right in the list view ->  AccountName  DisplayName. I would like the list view to show DisplayName on the left and AccountName on the right, this is the same order they show up on the form inside the repeating section with the DisplayName on the left and the AccountName on the right. In your example you have four controls and the order they appear in the repeating section is the same order they appear on the list view: Product, Quantity, ListPrice, SubTotal.

aymanelhattab
Nintex Newbie

No problem .. Glad it worked for you

inimri
Nintex Newbie

very nice post

anyone tried to export the list with Nintex column to excel?

Nintex column that you created is empty when i export the list to excel.

any idea why? Ayman El-Hattab

aymanelhattab
Nintex Newbie

Hi Ibrahim,

Yes, this is not supported.

Not applicable

Thank you Ayman, good work.

but how i can do it without using UDA? because am using Nintex WF for office 365.

artman
Nintex Newbie

Hi

This post is very useful, But I'm new in Nintex, I don't know how to use this field  because after deploy I can't find any new feature and I can't see this Nintex repeating section, after that I want to know value of this field can crawl with SharePoint search and can I use this field in content hub?

Thank you

Naeemeh

aymanelhattab
Nintex Newbie

Hi Naeemeh,

You don't need to activate a feature .. Once you deploy the WSP, you should find a new field type called "Nintex Repeating Section Data" in the column creation pages.

Indexing is not supported at this stage but will be added in later versions of the solution.

Thanks

aymanelhattab
Nintex Newbie

Hi Ibrahim,

Unfortunately, the solution is only available for SharePoint on-prem. If there is enough demand, I will create something for Office 365.

artman
Nintex Newbie

Hi El-Hattab

I deployed this solution after Installed but this field didn't add to my column how can I do?

Thanx

aymanelhattab
Nintex Newbie

Hi Naeemeh,

How did you deploy the solution?

artman
Nintex Newbie

Hi El-Hattab

Yes I deploy it But after I remove this solution this field became appear, I can use it but I removed that solution for testing, I don't know why this happened appear on my server.

Thanx

leif_frederikse
Nintex Newbie

Hi,

I have not yet tried this (not allowed to install the wsp yet) but it seems pretty nice.

One question: I need to have a view that presents the data in a way that is "Export to Excel" friendly. How would I go about doing such a thing?

Regards

Leif

inimri
Nintex Newbie

hi Leif,

this solution does not support export to excel,

if add the column to the list view and export it to excel, it will appear as blank.

if you don't have a complex form, check this blog Repeated Section to Plain Text

michaelpe
Nintex Newbie

Ran into an issue where I"m not seeing the option to activate on the site collection.

I have it deployed globally to all sites:

Capture.PNG

But I'm not seeing it as an option to activate on the site collection level. I retracted and deployed again and it is still not showing up. Have you came across this? SP Foundation 2013.

aymanelhattab
Nintex Newbie

Hi Leif,

SharePoint Custom Field Types are not supported in the Excel View unfortunately.

aymanelhattab
Nintex Newbie

Hi Michael,

You don't have to activate any features for a custom field type. Once the WSP is deployed, you can create columns based on the new custom field type (Nintex Repeating Section Data).

Not applicable

Hi Ayman,

I have tried your solution its working perfectly while adding new items.

But when i edit the item, in repeating control section it always shows the value of the last set of control values for all the child controls.

please find below the screenshots for the same.

nintex-repeatingsectiondemo.png

nintex-repeatingsection-editform.png

Not applicable

Can you tell me how the form gets rendered for the repeatin gsection

Not applicable

Hi First of all thank you so much for taking your time making this great solution. I got it to display on the list. however. is there anyways to pass these repeated section entries using the SQL server query to pass them into a sql server or whatever database/file?

DrewA
Nintex Newbie

This is a great solution...especially the .wsp file. IF I can get my enterprise SharePoint support to apply it to the farm/Central admin., is this field available for insertion into a Nintex workflow notification action email template?

jaime_soto
Nintex Newbie

This worked great for One of my list however when I attempted to perform the same on another list it fails to display the table. Have you had this error before?

Not applicable

Hi,

nice solution you have there.

i followed the instruction, but when i add new item, the column shows nothing. is there any other things to do?

kindly advise.

-willy-

jeffoliver1000
Nintex Newbie

Same things happens to me. Simple repeating table with a few fields and my list column is completely empty after a new form is submitted.