SharePoint provides access to the data stored inside a content database through a logical entity named a list. With the introduction of Business Connectivity Services it broke the barriers of connecting with data stored outside the content databases and give the list experience that a normal list gives. SharePoint facilitates Business Connectivity Services through a service application which facilitates deploying External Content Types to the SharePoint farm.

What is an External Content Type?

External Content Type is the interface for using the functionality offered through the Business Connectivity Services. It is a collection of reusable metadata descriptions. The metadata include,

  • Connectivity information – What is the data source and how the data are transferred
  • Definitions on data entities – What are the fields and their data types
  • Behavior of the data – How the data are read, written, and updated

 Advantages of using External Content Types

Introduction of the Business Connectivity Services unlocked doors for many opportunities with SharePoint. You can display information about blog posts in a site, may be tweets by a user, a set of data stored in a server located in another part of the world and many more.

Let’s see why External Content Types are preferred over many other alternatives.

  1. The list experience – One of the big advantages of External Content Types is that it provides the support to give the list experience together with the concept of External List. The data can be displayed, created, updated and deleted using a similar interface used for the lists.
  2. Reusability – Once an External Content Type is deployed to a server farm it can be used across all the sites inside the farm. You can display data, reference data and etc…
  3. Security – There is a great flexibility to manage access to the External Content Type by terms of who can execute data operations as well as manage permissions.
  4. Search – How about including data with built in SharePoint search? Yes that is also possible with External Content Types.

How to Create an External Content Type?

There are two tools that can be used to create an External Content Type. You can use SharePoint Designer and create an External Content Type and use it to create an External List. But with Visual Studio you can write your own logic with more control.

If you are using Visual Studio, you need to add an item with the template ‘Business Data Connectivity Model (farm Solution only)’. There you get a BDC Model with a designer window, BDC Explorer window and a BDC Method Details window.

Also two classes one for the ‘Entity’ and the other is ‘Entity Service’ class which is to write the method implementations for CRUD operations.

AddedIDProperty

Once the Entity is defined and services are written, the solution can be deployed to the SharePoint farm. The solution has a farm level feature which deploys the External Content Type built from BDC Model to the Business Connectivity Service application.

How to Use an External Content Type?

Once it is deployed, now you can create External Lists of it. In SharePoint 2013, you will find External List as a type of an app.

SiteContents

Also if you need to add a reference to an External Content Type, you can create a reference to it when you select External Data as the column type.

CreateColumn

If we go in depth with the External Data column, once a column is created, SharePoint creates another column referencing the same item with a “_ID” suffix that will store the current ID of the external content type item. This is why it is not considered as a lookup.

There are many enhancements for External Content Types in SharePoint 2013 such as using OData sources and different web parts.

With such capabilities and enhancements in hand, External Content Types become the best option for working with data located outside SharePoint.