CHAPTER 11
Application of Business Connectivity Services
In the previous chapter, we discussed all publishing features in SharePoint Online. In this chapter, we will discuss business connectivity services. Business Connectivity Service allows users to connect to external data using web services. We can integrate external content databases (Azure SQL DB, On-premises SQL DB). We can use a SharePoint designer to create an external content database and use it in the SharePoint list. Let’s discuss the business connectivity services configuration step by step.
Structure
In this chapter, we will discuss:
- Create an external content type
- Integrate external content type with SharePoint list
Objective
During the end of the chapter, you will get a clear understanding of:
- How to create an external content type
- How to integrate external content type with SharePoint
Create an external content type
We need to create an external content type using SharePoint Designer. Let’s follow the step by step process to create an external content type.
- Open SharePoint Designer. Click on Open Site.
- Enter the site URL
"https://spmcse.sharepoint.com/sites/bpb-modernteamsite
where you want to create the external content-type:Figure 11.1: Open SharePoint Site in Designer
- The site will open and click on External Content Type from navigation or ribbon:
Figure 11.2: Click on External Content Type
- Enter external content type Name (
EmployeeExternalContentType
) and click on Click here to discover external sources and define operations:Figure 11.3: Enter Name of External Content Type
- Click on Add Connection. One pop up will open to select Data Source Type from External Data Source Type Selection. Select the SQL Server as Data Source Type:
Figure 11.4: Add Connection to SQL Server
- We need to enter the SQL Server Connection details. Enter the Database Server name as Azure SQL Server Name and Database Name created under the Azure SQL database (EmployeeDB).
Figure 11.5: Enter Connection Properties Details
- The connection will be established to the content database EmployeeDB. Expand the content database and select the table Employee. Right-click on the table Employee and click on the option Create All Options:
Figure 11.6: Create All Operations
- Option Operation Properties will appear. Click on Next:
Figure 11.7: Operation Properties
- The Parameters Configuration option will appear. You will see table columns EmployeeId, FirstName, LastName, Address, PhoneNumber, DepartmentId under Data Source Elements.
- Select the checkbox Map to Identifier and choose Identifier as one field EmployeeId from Properties. Click Next:
Figure 11.8: Parameters Configurations
- Click on Finish from Filter Parameters Configuration:
Figure 11.9: Filter Parameters Configurations
- Click on Save present at the top left corner. Content-type is created now and ready to be applied in the external list:
Figure 11.10: Connection established
Application of external content type
We need to apply the created external content type in an external list. Let’s follow the step by step to create an external list:
- Navigate to site URL
https://spmcse.sharepoint.com/sites/bpb-modernteamsite
under which we created an external content type. - Click on New from the ribbon, select App.
- Click on External List one dialog box related to Adding External List will open.
- Enter the Name of the external list. Select the option Select External Content Type.
- Option External Content Type Picker will open where you can find existing external content types. Select the content type and click on OK:
Figure 11.11: Create External List
- External list Employee External CT will be created with added external content type:
Figure 11.12: Select External Content Type
- Now you can open the external list created from site contents:
Figure 11.13: External List Created
Conclusion
In this chapter, we discussed the use of business connectivity services. Discussed step by step procedure to create an external content type. Understood how to integrate external content type with the SharePoint external list. Next, in Chapter 13, Site Designing and Enhancement will discuss all editing, modifying, designing the SharePoint site.
Points to remember
- We can add Azure DB or on-premises SQL DB as an external data source following the same process of adding a server name and database name; there should not be any problem in that.
- In this chapter wherever its mentioned like this format
_layouts/15/****.aspx
, means this section is added after the site URLhttp:// <site url>/_layouts/15/****.aspx
. - Regular changes are applied in Office 365 and SharePoint Online by which there may be changes happening in the template or some other features.