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.
 
 1-SQL-Source-Tables-for-SharePoint.png
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.
 
2-SharePoint-Target-Lists.png


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.
 
3-SharePoint-Workflow-Set-Lookup.png
 
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‘.
 
4-SharePoint-Workflow-Set-Lookup.png
 
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.
 
5-SharePoint-Workflow-Set-Lookup.png
 
Fig.: Select Values to set in the SharePoint Designer workflow.
 
Select the data source list (‚Car Colors‘) and the field ‚ID‘ of this list.
 
6-SharePoint-Workflow-Set-Lookup.png
 
Fig.: Select Values to set in the SharePoint Designer workflow.
 
7-SharePoint-Workflow-Set-Lookup.png
 
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‘.  
 
8-SharePoint-Workflow-Set-Lookup.png
 
Fig.: Save your workflow settings. 
 
Now you are done with the workflow creation. To publish it, press the button ‘Publish’ in the ribbon.
 
9-SharePoint-Workflow-Set-Lookup.png
Fig.: Publish your workflow. 
 
As a next step you can update the SharePoint list ‘Cars’ using the BDLC ribbon button.
 
10-SharePoint-Sync-External-Data.png
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’.
 
11-SharePoint-Foreign-Key-to-Lookup.png
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.

Summary

​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.

Related Contacts
Frank Daske

Frank Daske

Business Development Manager
+49 (0) 40 28 41 12 - 30
sales@layer2.de

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

News

Layer2 Business Data List Connector for SharePoint V6 released with new Exchange Data Provider

Layer2 has announced a new version 6 of the Business Data List Connector (BDLC) that easily integrates external data with SharePoint. The connector comes with additional data providers and a new custom field mapping feature.

Layer2 Business Data List Connector for SharePoint V5 Released To Close Gaps With External Data Integration

Layer2 has announced V5 of the SharePoint Business Data List Connector that connects almost any external corporate data source with native SharePoint lists and closes many gaps that still exist with SharePoint 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 to the Layer2 Business Data List Connector (BDLC) for SharePoint.
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

Produktflyer: Business Data List Connector for SharePoint

Productflyer (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.

BDLC works with NINTEX Workflow 2010 for SharePoint

Start NINTEX Workflows while external data changes.

Layer2 BDLC for SharePoint Community Group @ LinkedIn

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

Sign Up for Layer2 Product Newsletter

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