vLookup setup example for SP 2010 and 2013

You find the full user manual here: https://spjsblog.com/vlookup-for-sharepoint/vlookup-user-manual

This guide will walk you through setting up a connection between two lists using the vLookup for SharePoint plugin in a Dynamic Forms for SharePoint enhanced form.

This tutorial will not cover the setup of DFFS, but you can find information here: https://spjsblog.com/dffs/dffs-download-and-installation/

Set up lists

Start by setting up two custom lists: Parent and Child.

Parent list

Create a single line text field named “_vLookupID” and a second single line text field named “vLookup_Children”.

_vLookupID: This field is used to hold an automatically created unique number used to link the parent and child item.

vLookup_Children: This field is used as placeholder for the child items in the parent list. When creating this field it is essential that the field internal name begins with “vLookup”. You can change the name to whatever you like after you create the field.

Child list

Create a single line text field named “_vLookupParentID”.
 
_vLookupParentID: This field is used to hold the _vLookupID of the parent item when creating a new child item to link the parent and child items together.

Install DFFS in both the Parent and Child list.

Configuration of vLookup

Go to your Parent list and click to add a new list item, scroll to the bottom of the form and hit the Enhanced with DFFS link to enter the DFFS configuration.

If this is the first time you enter DFFS config for this form you must hit Save to create a configuration for this form. If you fail to do this, your vLookup config will not work.

Click the vLookup tab at the top and locate the vLookup_Children link in the top of the page.

vLookupSetupExample_4

You find relevant information for each setting by hovering over or clicking on the question mark.

Set up list connection

Add the base URL of the list in the List base URL field and add the child list Display Name or list GUID in the List GUID, display name or URL name field and click Connect to list. This will ensure the connection is set up correctly.

vLookupSetupExample_6

Then click Show all fields in the child list and ensure the “_vLookupParentID” field is present. If not you must go back to the Child list setup above.

Build the query

This specifies the query used to pull the child items from the Child list. It uses current item _vLookupID and searches for matches in the _vLookupParentID field in the child list.

vLookupSetupExample_8

Add the fields to show from the child list

vLookupSetupExample_9

Add at least one column from the Child list to the ViewFields section:

The first Field: “Title” is the field internal name of the field in the Child list. The second “Title” is the display name you want to use as column header in the child item table when it is shown in the parent item. You can use any label you like here.

Use the table found under “Show all fields in the child list” for a complete list of fields in the “Child” list.

Show Item link in form

Set which form you want the “Item link” to be available.

vLookupSetupExample_10

Add new item and Prefill values in child

Configure “Add new item”. Set which form you want the new item button to be available and remember to add a label to the “Add new item label” field.

Click “Open new item link in new dialog box” and set the options you want for the dialog box.

In the “Prefill values in child” you must add “_vLookupID” in the From field and “_vLookupParentID” in the To field. This is important, and if you don’t fill this in you can create child items, but they will not be connected to your parent item.

Please note that your Child list NewForm must have an active DFFS configuration for the this to work. If you haven’t already added one, you must go to your child list and click to add a new list item. Scroll to the bottom of the form and hit the Enhanced with DFFS link to enter the DFFS configuration. You don’t have to configure anything at this moment, but you must hit Save.

vLookupSetupExample_11

Save the settings by hitting the save button in the bottom right corner.

vLookupSetupExample_12

Exit DFFS setup. Your form should look like this:

vLookupSetupExample_13

Connection using a lookup column

If you like to have a regular lookup column link between the child item and the parent you can use this alternate configuration, but keep in mind that a lookup column connection only works as long as the parent list does not exceed 5000 items.

Please note that using this approach you cannot add children from NewForm.

When using this approach, you don’t need to add the fields “_vLookupID” and the “_vLookupParentID” as described above.

This example uses a regular lookup column in the “Child” list that looks up in the parent items “Title” field – the child list field is called “ParentItem”.

The only things you need to change in the setup described above, are the “Build query” and the “Prefill values in child” section.

vLookupSetupExample_18

The field “ParentItem” in the “Child” list is a regular  lookup column targeting the “Parent” list.

vLookupSetupExample_19

Use the forum for any questions and feedback regarding this guide.

Alexander