Haaron Gonzalez Rotating Header Image

lookup

How to display additional lookup data from another list in a Nintex Form

Let’s say that you have a lookup site column that you are using all over the place in multiple lists and sites under your site collection and you need to be able to display additional data from this important list in a Nintex form, there is a way fortunately.

By adding this site column into your content type or list the Nintex Form will identify field as a lookup control automatically and by using the lookup function you can query another list in the site collection and return data from it.

In this example, I have a Stores list, every store has a district number associated, so when I pick and choose a particular store number by using the lookup function I am able to return the district for the selected store.

lookup1

To understand how the lookup function determines what data to bring back, consider the following lookup function:

[code language=”css”]
lookup(“listA”, “ID”, 1, “Title”)
[/code]

This lookup will send a query to SharePoint, asking for list items within a list titled ‘listA’ and return the Title column value from any list items whose ID column value is 1.
Note: The match on the value is case-insensitive.

The lookup function does not support complex query construction; it determines what list items are included, as data to bring back, based on the filter column being an exact match to the value you specify. You can compose complex formulas with the formula builder if you need to build up a complex query, however be mindful that each lookup function will send an individual request to SharePoint for data.

So, in my example I just added a Calculated Value control in the Nintex form and configure the lookup runtime function like this:

[code language=”css”]
lookup("/sites/mysitecollection|mylist","ID",Store,"District")
[/code]

Notice that there is a “|” to point to a list in another site, in this case, the top level site using a relative URL Path, then delimit the list title with a pipe ‘|’ symbol. If your list exists under your current site just use the list title without the URL Path.

lookup2