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

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


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:





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:



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

9 Hidden Costs of Power Platform

read more

Do you already work modern? (Part 5 of 5)

read more

5 years skybow - what a journey

read more