How to map existing SQL foreign key table relationships to SharePoint lookups using Layer2 BDLC and workflows?

​You can easily integrate almost any external data source with native SharePoint lists using the Layer2 Business Data List Connector, especially SQL tables or queries. But how to map existing SQL foreign key table relationships to SharePoint lookups? See below for a simple workflow-based approach.

SharePoint Integration: How to keep existing SQL foreign key relationships and map to SharePoint lookups

No problem to sync SQL tables or queries with native SharePoint lists using the Layer2 Business Data List Connector. But how to map existing foreign key relationships between these tables to SharePoint lookups? Generally you can solve these issue using a workflow approach as shown in the sample below.
Fig.: Sample database schema with two tables that are in a foreign key relationship.

The table ‘Cars’ contains a column with the name ‘ColorCode’. The column contains a reference (foreign key relationship) to the column ColorID in the table ‘Colors’. You have to create both lists (cars and colors) in your SharePoint and connect the lists via the BDLC with the tables as usual. See product description for more details.

Fig.: SharePoint lists connected to the database tables via BDLC

In the list ‘cars’ you have to create an additional lookup column manually, for example with name ‘Color Value Lookup’. This is a lookup field to the list ‘Car Colors’ to the field ‘Color’. If you start the update mechanism for both lists, you can see that the lookup column isn’t filled with values automatically. To create this association in SharePoint, you have to create a workflow for this list, which starts if an item is created or updated.
Fig.: SharePoint Designer Workflow

First of all create an action ‘Set Field in Current item’. After this step you can specify the field and value to set. Select the manually created Lookup field. In this case ‚Color Value Lookup‘.
Fig.: Select Values to set in the SharePoint Designer workflow. 
In the next step you have to select the value which the field should be filled with.
Fig.: Select Values to set in the SharePoint Designer workflow.
Select the data source list (‚Car Colors‘) and the field ‚ID‘ of this list.
Fig.: Select Values to set in the SharePoint Designer workflow.
Fig.: Select Values to set in the SharePoint Designer workflow.
In the next step you can specify the ‘primary key information’ (ColorCode) in list ‘Car Colors’ and the associated field ‘ColorCode’ in the current list. If you save your settings, there is a popup message with a warning, that your selection isn´t a field with unique values. You can ignore this and save the settings with ‚Yes‘.  
Fig.: Save your workflow settings. 
Now you are done with the workflow creation. To publish it, press the button ‘Publish’ in the ribbon.
Fig.: Publish your workflow. 
As a next step you can update the SharePoint list ‘Cars’ using the BDLC ribbon button.
Fig.: Update list items with external data via BDLC manually. 
If you currently have items in the list, you have to delete all of them and update again. Thats because of the BDLC changes only modified items. The lookup field is now filled with the information from the list ‘Car Colors’.
Fig.: The lookup field is now automatically maintained by the workflow in case of any data changes. 
If the workflow didn’t work as expected, you have to resave the BDLC settings by clicking ‘OK’ in the BDLC settings page and update your list again. Please note that this can be used as a replacement for the Layer2 Key Value Lookup Column product that will be not available for SharePoint 2013.


​Existing foreign key relationships between normalized SQL tables were mapped to SharePoint lookup-type relationships using the Layer2 BDLC to connect to the external data and simple SharePoint Designer workflows to keep the lookups current in case of external data changes.
Share this site on Xing
Share this site on Google+
Share this site on LinkedIn

We like the Layer2 Business Data List Connector for SharePoint very much – it helped us create a compelling SharePoint dashboard.

Frank Daske

Frank Daske

Business Development Manager
+49 (0) 40 28 41 12 - 30
[email protected]

Please note that the 011 exit code must be dialed first for all international calls made from the USA, Canada and Australia.

Related News

SharePoint 2016 Data Integration

The Layer2 Business Data List Connector (BDLC) closes many gaps that still exists with Microsoft SharePoint 2016 out-of-the-box external data integration via Business Connectivity Services (BCS).

Layer2 Business Data List Connector V7 Released to Close Gaps with SharePoint External Data Integration

​Layer2 has announced version 7 of their top-rated Business Data List Connector (BDLC) that connects 100+ external data sources with SharePoint lists codeless and closes many gaps that still exist with out-of-the-box SharePoint external data integration.
Related Downloads
NoDoc Image

Business Data List Connector PAD File

This XML-based PAD file offers a product description for resellers to download and publish.
PDF Image

Customer Solution Case Study: WealthVest Marketing Benefits From SharePoint Data Integration Using Layer2 Business Data List Connector

"By using the Layer2 Business Data List Connector for SharePoint app we can provide native SharePoint lists as a simple, easy-to-use, and familiar interface to manage mission critical business data."
PDF Image

Flyer: Layer2 Partner Program

Partner with us as a software distributer, reseller or SharePoint, Office 365 or Azure service provider. We are offering a free Partner Program with up to 30% Discount, free NFR licenses etc. Please download for more.
PDF Image

How to connect ANY external data source directly to native SharePoint lists?

Download this step-by-step introduction of the Layer2 Business Data List Connector (BDLC) for SharePoint on-premise.
PDF Image

How to integrate SAP data with SharePoint via NetWeaver & OData

You simply have to enter an URL to the data collection to integrate and sync SAP data with native SharePoint lists.
PDF Image

Product Flyer: Business Data List Connector for SharePoint

SharePoint on-premises external data integration with 100+ sources: Product flyer (PDF) in English for download.
PDF Image

Testimonial: How the US Defense Contract Management Agency (DCMA) integrates SharePoint with Oracle using BDLC

"Layer2 Business Data List Connector (BDLC) software provides a powerful mechanism for surfacing external data through lists, and drastically improves platform stability and development cycles."
Related Links

Are you looking for partners in your region?

Please find a local partner here.

Layer2 BDLC for SharePoint Community Group @ LinkedIn

​Are you already @ LinkedIn? Please join our group to share your experience.

Purchase Layer2 Business Data List Connector via ComponentSource

​ComponentSource has offices in the USA, UK and Japan supporting over 125,000+ Customers, in over 180 Countries. They are also an approved Federal Government supplier through the GSA Schedule.

Sign Up for Layer2 Product Newsletter

We keep you up-to-date about new Layer2 product releases, added features and fixed issues.