Templating using Cascaded Lookup

<< Click to Display Table of Contents >>

Navigation:  Cascaded Lookup >

Templating using Cascaded Lookup

Previous pageReturn to chapter overviewNext page

"Populate additional fields from Lookup List" in the Advanced Settings for the Cascaded Lookup is where Templating is set up.

 

clip0036

Populate additional fields from Lookup List -- if checked, Field Mappings can be used, as explained below. This is normally used as a templating function. There would be a list of "templates" that have pre-filled fields. These templates provide default values to the new item being created. The list of templates is shown in the Lookup column on the new item. When one of the templates is chosen, fields on the new item are populated based on the values on the template.

 

Fields Mappings (JSON) -- This is used to preset values in other columns when a choice is made from this column’s drop-down list. The values set in the parent item come from values in columns on the lookup item. (Note: JSON = JavaScript Object Notation)

 

To map lookup columns with parent item columns, construct a text string as follows and put it in the Field Mappings box . It is best to build the string in Notepad, then copy it into the box.

 

The string must start and end with curly brackets. For each column that is to be given a preset value on the parent item, there needs to be an element that tells what to copy from the lookup item to the parent item. Each element is separated by a comma.

{element, element, element, ...}

 

Syntax of the elements:

 "lookup item column name":{"Name":"parent column name", "Type":"name of UI control"}

 

Example of an element: "Title":{"Name":"Title", "Type":"input"}

 The first "Title" is name of the column on the lookup item that is to be copied over to the parent item.

 The text in curly brackets tells where to put this value on the parent item. The "Name" and "Type" words do not change.

 

"Name" is the name of the column in the parent item where the value from the lookup item will be put. In this example, the parent item column is also named "Title".

 

"Type" is the type of UI control for field in the parent item. SharePoint uses different types of  controls for different column types. Single line of text uses ‘input’, multiple lines of text uses 'textarea', choice uses ‘select’, hyperlinks use 'inputlink'. Contact support for more control types, if needed.

 

Example of a string with multiple elements:

{"Title":{"Name":"Title", "Type":"input"}, "Category":{"Name":"General Category", "Type":"select"},"Description":{"Name":"Item Description", "Type":"textarea"}}