Vladi Gubler
Vladi Gubler
July 25, 2013

Hello,

Update: new feature in Smart Import Pro - you can now use a single Sync action to automatically create or update items in your list!

Today I'm going to show you how to easily synchronize any database table with a SharePoint list. We are going to achieve the following functionality:

  • DB and SharePoint columns are mapped according to our own logic (column names do not have to be the same)
  • New items are automatically created in the list when they are added to the DB table
  • Existing items are updated in the list when they are updated in the DB table
  • BONUS! Changes in the list are updated in the DB table

We'll be using Smart Import Pro to handle importing new and existing items from the DB to the list. Smart Import Pro is capable of importing emails, DB tables (any type of DB would work) and even web services.

For sending updates back from the list to the database, we'll be using Smart Action Pro, our most versatile component. It has the ability to run stored procedure in any DB with parameters coming from a SharePoint list item.

To successfully synchronize a DB table, you would need it to have the following columns (the column names can be anything you want):

  • Unique identifier - any text/number field that is unique across all items in the list.
  • Created Date - date/time column containing when the item was first created. This column value should not be subsequently changed.
  • Modified Date - date/time column containing when the item was last modified. When the item is first created, its Created and Modified dates should be the same.

In the SharePoint list, you would need to store the DB unique identifier in any suitable column. It's advisable to make the column indexed to improve performance. You would also need to crate suitable columns to contain DB column values without losing the data types. You can always import any DB column into a SharePoint text column.

Now let's create an import profile for our SharePoint list.

  • Go to List Settings of the list.
  • Click on Import settings.
  • Give an easily identifiable name to your new profile.
  • Specify the polling schedule, the import can be as frequent as every 15 minutes.
  • Change the provider type to Database.
  • Select the relevant database type.
  • Enter a valid connection string, according to the database type and authentication mechanism
  • Choose authentication type:
    • Connection string - username/password are provided in the connection string.
    • Service account - SharePoint Timer service account credentials are used.
    • This account - enter username and password to be use for authentication. Username and password are going to be encrypted and stored within the profile.
  • Click on Connect to display the available tables/views.
  • Select the relevant table.
  • Select update date column, it should be the Modified date in your DB table.
  • You do not need to fill out File content and File name columns.
  • You can now create your import action. We would need two import actions, one - to import new items, and the other - to update existing items.
    • Select Create list item action type
    • Enter an action name
    • Map values to the SharePoint columns. You can use text, DB column names and functions. Use the value picker to generate valid expressions.
    • Add a condition: Created Equals [Modified] to require both columns in the database item contain the same value, which means it's a new item, as only new values should be handled by the Create action.
    • Save the action
    • Select Update list item action type
    • Enter an action name
    • Map values to the SharePoint columns in the same way you did before.
    • Add a condition: Create Not Equals [Modified] to only handle updated items.
    • Under Item add a condition by mapping the unique identifier value stored in a SharePoint column to the relevant DB column. That will ensure that you are updating the correct SharePoint item.
    • Save the action.
  • Save the profile

We've know established a one-way synchronization from the database to SharePoint. If your solution requires two way synchronization, continue reading.

You would need a stored procedure in your database that updates an item with the values it receives as parameters. Next, you need to create a Smart Action Pro action to run this stored procedure whenever a list item is updated.

  • Go to List Settings of your list.
  • Click on Actions settings.
  • If no action column exists, create one, you can use the default name Actions.
  • Under Add/update action, select action type Run DB stored procedure.
  • Uncheck New under Run on events leaving just Edit.
  • Switch to Action Settings tab.
  • Select the relevant database type
  • Enter the connection string (the action will be performed under the application pool identity)
  • Click Connect.
  • Select the stored procedure.
  • Map the procedure parameters to the column values and/or expressions. Make sure that your stored procedure accept the unique identifier as one of the parameters and uses that parameter to select a single item to be updated
  • Save the action.

That's it, your two-way synchronization with an external database table is now established. Wait for up to 15 minutes
(depending on your polling schedule) for the list to be filled with the database items, start updating the items and see the changed reflected in both the database and in the list.

 

Loading...

Add your comment

Comments are not meant for support. If you experiencing an issue, please open a support request.
Build powerful business applications in SharePoint using only your browser.
100% No-Code Solution
It’s never been easier to create, innovate, and share. All you need is your web browser!
Cost-Effective
Address business process pain points immediately. Save time and money.
Fantastic Support Team
In addition to our responsive support team, a wide variety of resources, documentations, tutorials, blogs and webinars is available to you
WELCOME TO THE FUTURE
New faster ways for creating business solutions
ULTIMATEforms is a platform that enables everyone to easily create and maintain Microsoft SharePoint-based business solutions without a single line of code
Simple and Intuitive
Streamline form creation with smart, user-friendly tools
Deploy smart dynamic forms that adapt to your business needs
Utilize a drag-and-drop interface for effortless form design
Experience rapid form customization with intuitive editing tools
Accelerate project timelines with user-friendly, immediate solutions
Powerful Automation
Enhance operational efficiency and compliance
Streamline complex workflows into straightforward actions
Quickly establish compliant business processes
Seamlessly integrate data from diverse applications
Access and combine information easily for better decision-making
Comprehensive Reporting
Transform data into actionable insights
Generate detailed reports and dashboards for informed decision-making
Customize alerts and notifications to stay updated
Print and export data to PDF, Excel, or Word for easy sharing
Visualize data with color-coded calendars and intuitive dashboards
100’s of Templates
Streamline form creation with smart, user-friendly tools
Access hundreds of customizable templates for every business function
Install easily with one-time set-up; free for ULTIMATEFORMS customers
Replicate entire sites with settings between site collections and tenants using Template Manager
Jumpstart projects with pre-built solutions from our growing catalog, applied with a click
Dive deeper
Watch a short introductory video showcasing the different unique capabilities of UltimateForms.
Ready to get started?
Hands-on training is the best way to get proficient. That's why we've created three unique training offerings which will help you master ULTIMATEFORMS. Our interactive sessions are delivered via web meetings and conducted within personal virtual workspaces.
100% No-Code Solution
It’s never been easier to create, innovate, and share. All you need is your web browser!
Cost-Effective
Address business process pain points immediately. Save time and money.
Fantastic Support Team
In addition to our responsive support team, a wide variety of resources, documentations, tutorials, blogs and webinars is available to you
Microsoft partner logo GSA Schedule
© 2005-2024 Infowise Solutions Ltd. All rights reserved.
Privacy | Accessibility | Cloud SLA