With the Repeating Rows column you can implement the following 2 common use-cases:
Multi-row form - this is done by connecting 2 lists, one is the "master", 2nd one hold the "details" items.
"Connected documents" - this is done by connecting a document library to a "master" list, this way users can upload and connect multiple documents to each list item.
Let's see how to configure the Repeating Rows column to support these 2 use-cases.
To implement a multi-row form, follow the steps hereunder:
Before you create a Repeating Rows column, you need to have your connected lists – a “Master” list and a “Details” list. In our example, we have the following 2 lists:
· Expense reports list – This is the “Master” list. Each item in this list is an expense report item, made by some employee. The list includes the following columns:
· Expense details list – This is the “Details” list. For each expense item in the Expense reports list, we have here multiple expense details items. The list includes the following columns:
o Expense type
o Expense details
Once you have your data model ready, it’s time to create your Repeating Rows column.
In the “Master” list (Expense reports), create a Repeating Rows column that will display multiple rows from the “Details” list. To do that, click the “Manage Repeating Rows” button to open the list’s Repeating Rows settings page:
The Repeating Rows app relies on services provided by the KWizCom Apps Foundation app. When you browse the Repeating Rows settings page and KWizCom Apps Foundation is not installed, you will be prompted to install it. For more details, please review the installation procedure section in this user guide.
Once you click the ribbon button, you’ll see the following settings page:
Configuring a Repeating Rows column is done by following the steps:
1. Select a repeating rows column You can create new Repeating Rows column, or edit existing ones (if created before). If you create a new column, type its name in the “New column title” textbox.
2. Decide how many rows should be displayed by this column by default When you create a new item, the Repeating Rows column will display 3 empty rows by default, you can change that to any other number.
3. Decide if you want to allow end-users to add rows You can allow users to add rows to the Repeating Rows column when they add/edit items. If you choose to allow users to add rows, you can also rename/translate the caption of the “add row” link that will appear below the Repeating Rows column in new/edit item forms.
4. Connect the Repeating Rows column to a target list Select a list to which you want to connect your Repeating Rows column. In our example that would be the “Expense details” list.
The target list should be an empty list, used only to store the Repeating Rows items. If you connect the Repeating Rows field to a list that includes data in it, all the existing data items will be deleted.
5. Select which columns should be displayed in the Repeating Rows column Click the box to add columns from the target list (“Expense details” list in our example) to the Repeating rows column. These columns will be displayed according to the order that they were added.
6. Configure columns’ layout and preview Now you can see how the Repeating Rows column will look like (column order) by looking at the preview section at the bottom of the settings page. You can also configure a column’s width*and add total function to selected columns. To configure column width and/or a total function for it, simply click the icon – this will open the following popup:
Each total field will be also available as a Number column that can be displayed in the list views.
Resizing field’s width is not available for Date, Boolean, Choice and Lookup columns since these columns have their width pre-defined and optimized
7. Save your settings That’s it! Now you need to click “Update” to save your settings.
After you’ve created the Repeating Rows column it is time to check your configuration by simply creating a new item in your “Master” list.
In our example, we’ll create a new “Expense report” item:
So, now you can create/edit an expense report along with connected expense details rows.
Once you click the “Save” button the Expense report item will be saved, along with the expense details rows that will be saved in the “Expense details” list in our example.
Upon clicking Save, empty rows will automatically be removed before the form data is saved.
COMMENT2 You should NOT edit items directly in the “Details” list to which the Repeating Rows field is connected, but only by using the Repeating Rows column in the “Master” list. If you edit these items directly in the “Details” list, the summary fields will not be display correctly. Also, if you add any items directly to the “Details” list – those items will be deleted by the Repeating Rows app cleanup job.
Lookup fields that are included in the Repeating Rows column will display up to 2000 items. This limitation was set to prevent performance issues (because the Repeating Rows column might display many rows, each loading thousands of lookup items).
One more thing for you to check, is the existence of the summary fields as new columns available for list views:
So, you can display these summary fields in your list views just like any other column in your list.
In the previous section we saw how to create a Repeating Rows column that connects to a “Details” list. In this section we’ll show a different scenario where you connect the Repeating Rows column to a “Details” document library. This enables you to connect multiple documents to an item and update them while you update your item:
In the screenshot above you can see multiple documents can be connected to a single Issue item.
How is this different than SharePoint file attachments?
1. Since the actual documents are stored in a separate document library you can configure different permissions to selected documents, according to your requirements.
2. You can configure the Repeating Rows column to show selected properties of the connected documents (in attachments you don’t have any properties)
Setting up connected documents is very similar to what you saw in the previous section when we connected a master list to “Details” list, however when you select a document library in the “Select a target list” property you will see the following additional properties:
· Enter sub folder name: you can have all connected documents grouped for better organization (rather then have them all as one huge pile of documents). You can type a folder name or you can select a value from the “insert a column” drop down, which enables you to create a sub folder with a dynamic name, according to selected item column. Example: if you want each item’s connected document to be saved under a sub-folder which its name equals the item’s ID, you should select the ID column:
· Show the file name in the repeating rows? By default, repeating rows will simply show the file type icon, but you can show the file name if you like.
When you create a Repeating Rows column in your list, the result is a lookup column that connects your “Master” list to a “Details” list.
Looking at our “Expense Reports” list columns, you can see that the “Expense Details” column that displays multiple rows in the list forms, is actually a regular Lookup columns:
This enables us to link between an item in the “Master” list and its connected multiple items in the “Details” list.
But that’s not all:
If you open one of the “Details” item, in our example an item in the “Expense details” list you will see a “Master Item” Lookup column:
This reverse Lookup column is automatically created in the “Details” list when you create the Repeating Rows column. We create it to enable you to navigate from a “Details” item to its “Master” item, or in our example: you can navigate from any expense details item to its expense report item.
When you configure a Repeating Rows column you can create summary fields for selected .
In the screenshot below you can see that we have configured a summary field below the “Cost($)” column:
The result of this configuration, besides the fact that users will see this summary field while they create/edit and item, is that a Number-type column is created in the list for each summary field, so you can add these summary columns to your list views.
COMMENT Summary fields are updated when you use the Repeating Rows column. If you bypass it by updating the “Details” items directly from the “Details” list, the summary fields in the “Master” item will not get updated.
There are several cases to consider:
1. What happens when you delete a “Master” item?
2. What happens when you delete a “Details” item in the Repeating Rows column?
· When you delete a “Master” item, you will be prompted with the following message: Meaning: we do cascaded delete, so if you delete a “Master” item, we will delete all its connected items in the “Details” list (no point in leaving orphan items, right?)
· When you delete a “Details” item in the Repeating Rows column, it does not get deleted right away in the “Details” list. What happens instead is that its reverse Lookup that connects its “Master” item gets deleted, so it becomes orphan. Why do we do it? Because we cannot know for sure we really need to delete it until the user commits his action by saving the “Master” item form. If instead, he clicks “Cancel” after deleting a “Details” item, then we need to revert that deletion. So, what we do is use aremote event receiver. That event handler will run the next time someone updates an item in the list, and will check for all orphan items in the “Details” list that need to be deleted, or need to be reconnected with their “Master items”. So why are we telling this to you? So you won’t be surprised to see that “Details” items that you deleted, are still there. Don’t worry, they will be deleted after several minutes, and will not appear in your forms anyway.