vLookup setup example for SP 2010 and 2013

You find the full user manual here: http://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.

Prerequisite

Before you can set up this vLookup connection you need to have a working DFFS solution set up in the “Parent” list. You must also add a list “Child” somewhere in the site collation. This tutorial uses a list in the same site as the “Parent” list.

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

The screenshots are from the latest version of DFFS and vLookup for SP 2010 / 2013. If you are using an older version of the plugins, or you use SP2007, you cannot use this approach for the connection between “Parent” and “Child” list.

The concept is still the same, but you cannot create children from NewForm, and must use for example a lookup column in the child list targeting the parent list as the connection.

Set up lists

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

vLookupSetupExample_1

In this example I will set up the connection in a way that adds support for adding children directly from NewForm of the parent list item.

This is done by adding one field”_vLookupID” in the “Parent” list, and a field”_vLookupParentID” in the “Child” list.

You can use other connections between the two lists – like a regular lookup column in the child list that lets you select the parent. This will however not let you create children in NewForm as the parent item does not yet exist.

You find some more information here

Configuration

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

In the Parent list, enter DFFS setup and go to the Misc tab.

Create the vLookup column

This is the column that “holds” the connection to the child items.

This column MUST start with “vLookup” when you create it for the solution to recognize it. This is because the “internal name” is set the first time you create a field, and this is the name used by the vlookup.

Click “Add new field” to open the “Create column” dialog.

vLookupSetupExample_2

This button is not present in SP2007 and you must add fileds form the regular list settings page.

vLookupSetupExample_3

You can rename the field to whatever you like after you have first created it. This must be done in the regular list settings for the current list.

When the vLookup field has been created, go to the vLookup tab in DFFS backend:

vLookupSetupExample_4

Add _vLookupID column to “Parent” list

This column is used to hold an unique item ID to use for the connection between “Parent” and “Child”.

Click the “Using vLookup from NewForm” header and set up the column “_vLookupID” in the “Parent” list by clicking the “Add column” button.

vLookupSetupExample_5

Click the field name to open the configuration for this field.

Set up list connection

Add the child list “Display Name” or list GUID 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 add the “_vLookupParentID” field to the child list.

Add _vLookupParentID column

vLookupSetupExample_7

Verify that the new field is listed in the field table when you have added the field.

Set up the query

vLookupSetupExample_8

Set up the fields to show in the child table

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

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

Misc

Configure the “Misc” settings like this:

vLookupSetupExample_10

Add new item

Configure the “Add new item” settings like this:

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

Child list

You now need to do one of the following:

  1. Set up DFFS in the “Child” list
  2. Use the vLookup receiver for NewForm in the “Child” NewForm page

This tutorial uses the vLookup receiver for NewForm.

Add vLookup receiver to NewForm

This is only necessary when you are not using DFFS in the child form.

Edit the default NewForm and add a CEWP with a link to the “vLookup_ListView.html” file.

You find this file as part of the DFFS JSLink download package, but you can easily create it by looking at the format in the user manual: http://spjsblog.com/vlookup-for-sharepoint/vlookup-user-manual/#vLookup_receiver_for_NewForm

vLookupSetupExample_14

vLookupSetupExample_15

Save the form and return to the “Parent” list to test the connection by pressing the “New child item” link.

vLookupSetupExample_16

This is how the child items show up in the parent. You find more information about how to configure all the options in the user manual: http://spjsblog.com/vlookup-for-sharepoint/vlookup-user-manual

vLookupSetupExample_17

Alternate connection

When using this approach, you don’t need to add the fields “_vLookupID” and the “_vLookupParentID” that are described above. Please note that using this approach you cannot add children from NewForm.

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

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

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