Sharepoint SIG

Thoughts and ideas from your SharePoint support team

Using Nintex Forms “List View” feature to implement Parent-Child functionality (partially)

| 0 comments

Nintex Forms has a control called the List View.  This control can be used to implement a parent-child relationship between two SharePoint lists.  For example, if you have an invoice with one or more items, the invoice itself is the parent and each item on the invoice is a child.  The invoice items are attached to the invoice using a unique identifer such as the invoice number.Unfortunately the Nintex List View control displays the children with a link to edit them, but does not provide a way to add new child records through the form.  Adding children has to be done through the child list, typing in the parent’s ID manually.  This limits its usefulness for many scenarios.  Nintex support has forwarded my request for this feature to their development team but there is no indication of when (or if) this will be implemented.

For information on using SharePoint Designer and the built-in SharePoint forms to implement this type of functionality, see previous posts:

http://words.usask.ca/sharepointsig/2012/04/16/parent-child-relationship-between-two-lists-in-sharepoint-part-1/

http://words.usask.ca/sharepointsig/2012/04/16/automatically-set-the-parent-id-field-in-a-child-record/

There are two ways to set up the parent-child relationship with the Nintex List View.  I will explain both in this post.

The first task is to create your parent and child lists with the necessary fields.  As with the SharePoint Designer solution, the child list must be linked to the parent list using the automatically generated ID field (or alternatively, a different field in the parent record that is guaranteed to be unique).  To do this:

  1.  Go to the list settings of the child list.
  2.  In the Columns section of the settings, click on Create Column.
  3. Create a column of type Lookup; set it to get information from the parent list and its ID column (or other unique field that you are using to link the two tables).

Once the two lists are set up, open up the Nintex Form for the parent list to add the List View control.

  • Click on the List tab for the parent
  • Click on the “Nintex Form” button in the “Customize List” section of the ribbon
  • Nintex Forms button

    Nintex Forms button in the Ribbon

  • When the form opens up in design mode, click on the SharePoint section of the Form Controls panel at the left.

NintexFormControls

  • Drag the List View control from the panel to the form.  Resize as desired.
  • Double-click the List View control to open up its settings dialogue box.
Nintex List View Control settings dialogue box.

Nintex List View Control settings dialogue box.

  • Choose the child list from the Lists drop-down

Once the above steps have been done, you can choose either of the following methods.

By a Specified Value

  • Click the + beside Filtering to view the settings
Nintex List View Filtering Options

Nintex List View Filtering Options

  • Change the “Filter listed items” from “Display all items” to “By a specified value”.
  • If you click the Insert Reference icon beside the “Where field” box (little book icon), you will see a list of fields from the Parent list.  Since the “Filtered by control” field also displays a (partial) list of fields from the Parent table, this won’t help you.  Instead, type the name of the field in the child list that links the two tables directly into the box.  NOTE that the case of the field name has to match the field’s definition in the child list.  “Parentid” does not equal “ParentID”.
  • Click on the Insert Reference icon beside the “Filtered by Value” box.
  • Click on the Item Properties tab.
Nintex Insert Refenence box

Nintex Insert Refenence box

  • Double-click on the ID field (or whichever unique field you are using to link the tables).  It will appear in the “Dynamic text to insert” field at the bottom.  Click OK.
  • Click the Save button for the Control Settings dialogue box.
  • Click the Publish button in the Nintex Forms 2010 ribbon.
Publish button in Nintex Forms

Publish button in Nintex Forms

  • Close the form design view.

Back in the Parent list, click on the title of one of the entries to open up the Display form.  You will see the information about the parent at the top with the list of child items underneath.

Nintex form showing parent record and children.

Nintex form showing parent record and children.

 By a Control’s Value

The other option is to use the “By a control’s value” setting in the filtering section.  The Nintex definition of a “control” is a field that is editable.  Therefore, the automatically generated ID field plus date fields such as Creation Date or Modified Date are not available to link the parent and child records.  If you want to use this setting, you have to choose an editable field as the link between the two tables.  If you want to use one of the automatically generated fields, you would have to create a field and populate it with the value of the automatically generated ID field via a workflow on create.

Once you have created an editable field and populated it correctly, use the same steps as above to configure the List View, with these exceptions:

  •  Choose “By a control’s value” rather than “By a Specified Value”.
  • The “Filtered by Control” field will be a drop-down and will not have the Insert Reference icon beside it; choose the parent field from this list.

Sheila ffolliott

Analyst, SharePoint team

Leave a Reply