<img height="1" width="1" src="https://www.facebook.com/tr?id=730305433807073&amp;ev=PageView &amp;noscript=1">
Start
Book a Demo

Dynamic Forms - Part 5: Making values in the “Subindustry” field dependent on the “Industry”.

avatar

Posted by Adis Jugo - 25 August, 2016

 

SharePoint’s “Subindustries” list has two fields – “Title” and “Industry,” which is itself a lookup field to the “Industries” list. It makes sense in the “Leads” form to make those two fields dependent: after a user selects an industry, only those values that belong to the corresponding industry will be shown in the “Subindustry” field. For example, if the user chooses the “Information Technologies” industry, the only choices that should be presented for the “Subindustry” field should be “Semiconductors,” “Software,” and “Hardware.” This is called “cascading lookup fields,” and it is not possible in SharePoint without heavy customizing. With skybow Solution Accelerators, it is achievable within seconds. 

To achieve this, we need to put the filter on our “Subindustries” lookup field in the skybow Solution Studio. This filter is in the form of a CAML query, and defines the fields of the “Subindustries” list that the lookup will be filtered by (in our case it is the “Industry” field of the “Subindustries” list), and which value that field should have (in our case the value of the “Industry” field of the lead that we are adding or editing).

We will open the “Lookup settings” of the “Subindustry” field, and click on the query icon beside the “Query for Lookup” field. That opens the visual CAML query builder:

 

 

dynamics_11a_subindustryloo.png

 

Creating cascading lookups through setting the lookup queries

 

In the CAML Query Builder popup window, we will set the Where clause as the “Industry” field of the “Subindustries” list, set to the value of the “Industry” field of the current “Leads” item (use the [[Industry.ID]] placeholder from the skybow expression engine to achieve this).

Press the “OK” button, and the resulting CAML query will be:

<Where><Eq><FieldRef Name='Industry' LookupId='True'  /><Value Type='Lookup' >[[Industry.ID]]</Value></Eq></Where>

When we save the changes, we will see that the “Subindustry” lookup field behaves exactly as it should – as a field dependent on the “Industry” field:

 

dynamics_12_SubindustriesLookupAnimation.gif

Behavior of cascading Industry-Subindustry lookups

 

In this way, within seconds, we have met the customer’s requirement for cascading lookup fields in SharePoint forms.

 

You want to read the whole story? Click here to get the eBook!

Rich Forms eBook


Recent Posts

The real digital workplace

read more

A personal letter to all Microsoft Cloud Solution Providers

read more

The skybow Partner Day & Awards 2019

read more