Knowledge Base

How to sync changes from a SharePoint list to external data source?

BoostSolutions’ Data Connector integrates external data sources (SQL Server, Oracle Database, MySQL Database and external SharePoint list) with native SharePoint list, and it enables you to sync data from SharePoint list to an external data source as well. Also, you can choose whether to sync the changes (creation, modification and deletion) to the external data source and how to sync them.

In this article, we will demonstrate how to sync changes from a SharePoint list to SQL server database.

WHAT YOU'LL GET

Choose how to sync changes from the SharePoint list to external data source

WHAT YOU'LL NEED

The sample data we use for this case

Create a table named as Computers in the SQL server database BoostSolutionsEnterprise on the SQL server dbserver3, the table contains the same fields as that in the SharePoint list Computers.

Sync changes from a SharePoint list to SQL server database

  1. Download the trial version of Data Connector and install it to your SharePoint server.

  2. Navigate to the site in which the Computers list is located.

  3. In the upper right corner, click Settings and then click Site Settings.

  4. On the Site Settings page, click Data Connector Settings under BoostSolutions Software section in the bottom right corner of the page.

  5. On the Data Connector Settings page, click Create Job.

  6. After clicking Create Job, you will enter the Edit Job page.

    In the Job Name section, specify a unique name for the job, such as job-1.

  7. In the Direction section, specify the direction for the data connection. Select From list to external data option.

    When the direction is set as From list to external data, then the SharePoint list is the data source, and the external data source is the target.

  8. In the List section, specify a SharePoint list or Document Library from which you want to sync data to the external data source. Click to browse and select the Computers list from the drop-down list.

    In the Choose a view drop-down list, select a view to filter items, here we select the All Items view, which means that the items contained in the All Items view will be synced to the external data source.

    If you select All list items (No filter), it means that all items in the SharePoint list will be exported to external data source.

    Note:

    Note that the personal views will not appear in the drop-down list.

  9. In the External Data and Authentication section, configure the settings as following. Specify the external data type and database authentication. (Ensure the user account you specify has the appropriate permissions to access the external data source.)

    External Data Type: Select SQL Server as the external data type.

    Database Server: Enter the SQL server’s name or its IP address.

    Database Authentication: There are two types of authentication, Windows Authentication and SQL Server Authentication.

    Windows Authentication: Select this authentication if you want to use the application pool account to access the SQL database. You need to enable Windows Authentication as the Authentication Mode in SQL Server in order to access the database successfully.

    SQL Server Authentication: If you select this authentication, you need to enter a SQL user name and password to access the database.

    Here we select the SQL Server Authentication.

    Username: Enter a SQL user name. The user should have Write permission to the database.

    Password: Enter the user’s password.

    Click Connect to connect the SQL Server we specified (the dbserver3 in our case). If everything goes right, it will show Connection successful below the Connect button. And the databases existed on the specified SQL server will be populated to the dropdown list as shown in the picture above.

    Database: Select a database, here we select BoostSolutionsEnterprise.

  10. In the Data Settings section, specify which external data will be connected to the SharePoint list. Select dbo.Computers (the table Computers stored in the BoostSolutionsEnterprise database as we described in the sample data section) from the drop-down list as following.

  11. In the Column Mapping section, map the list columns to database fields as following.

    Because the columns’ name and type are the same in the SharePoint list and the SQL database, the columns will be automatically mapped by default.

    Select Barcode column as the key. A “key column” is one that uniquely identifies records and can be used to compare data sources.

    If the columns name or type are different between SharePoint list and external data source, you have to map the columns manually by clicking Add a column mapping link.

  12. In the Run Options section, specify whether to enable Add, Update or Delete operations separately while running this job. Select the first three options as following. By default, the first three options are selected.

    Enable ADD operations: Add records that only exist in the source.

    Enable UPDATE operations: Update records that exist in both the source and the target.

    Enable DELETE operations: Remove records that only exist in the target.

    Note:

    Note that the options are also available for other external data sources, including Oracle, MySQL and SharePoint list.

  13. Keep other settings as default and click Save to save the settings.

  14. And then you will find that the job has been created on the Data Connector Settings page, the job-1.

  15. Click the Run button for the job-1 and waiting for the job to be run completely.

  16. After the job run completely, click Close. In the SQL server database, check the table Computers. And then you will find that the items in the SharePoint list have been successfully synced to the SQL server database as following.

  17. In the Computers list, create a new item AST0107 as following.

  18. And on the Data Connector Settings page, click the Run button for the job-1 and waiting for the job to be run completely.

    After the job run completely, click Close. In the table Computers in the SQL server database, you will find that the new item AST0107 has been synced to the database as following.

  19. In the Computers list, select the item AST0107 and modify its Owner from Amy Fetter to Glenda Phillips.

    And on the Data Connector Settings page, click the Run button again for the job-1 and waiting for the job to be run completely.

    After the job run completely, click Close.In the table Computers in the SQL server database, you will find that the item AST0107 has been updated as following.

  20. In the Computers list, select the item AST0107 and delete it.

    And on the Data Connector Settings page, click the Run button again for the job-1 and waiting for the job to be run completely.

    After the job run completely, click Close. In the table Computers in the SQL server database, you will find that the item AST0107 has been deleted in the table as following.

Login