Importing Documents and Metadata into a SharePoint Document Library
This guide will walk you through how to import documents and their corresponding metadata into a new SharePoint document library. This guide assumes that you have a file directory containing your documents to be added and the metadata is contained in an excel spreadsheet.
Files can be contained within folders, these folders will be added to SharePoint. For more information on changing file paths in SharePoint please see our SharePoint Folders page.
You can also bulk upload documents and folders into SharePoint straight from Excel. The guide on how to do this can be seen here.
Before you begin following through this guide you need to make sure you have the data prepared and together.
Documents to be Uploaded
The screen capture below shows a directory of Word Documents that we will be moving into a SharePoint Document Library.
We also have an Excel Spreadsheet with sample metadata that we want to add to the documents in the library during the upload. The document maps FileName to the actual Filename of the Word Document in the directory.
Document Library in SharePoint
Finally, within SharePoint we have created an empty document library with the metadata columns already pre-defined.
Connect to the File System
To configure this project we first need to connect to our source. In this example it is the file directory on our machine.
Connect Datasource in the Datasource A window and choose the
File System >
Locate the folder that contains your documents by clicking on the ellipsis (...) in the Path field. Once you have done so, click
Connect to load the data source.
Connect to the Document Library
Now we need to connect the target to our document library in SharePoint. As we are using SharePoint online in this example, choose the SharePoint Online Provider from the connection menu. Enter the site URL and your credentials.
You will then be able to choose the document Library from the drop down menu in the ListName field.
Once you have done this click
Connect & Create Library Connection to save your connection to the connection library. Doing this opens up the connection library window where you are asked to type in a name for your connection. Click
OK once you have typed in a title.
Data Sync's automatic mapping rule system will prompt you to select a rule to apply, press
Apply to apply this rule.
Now at this point, Data Sync is configured to import the documents to SharePoint. However, as we want to add the metadata we have one more step to go.
Add the Metadata
FullFileName column in Data Source A and press the
Add Lookup button in the data source toolbar to create a Lookup.
This will open up the connection window. Find and select the Excel Provider (
OpenXML Excel Spreadsheet) and locate the excel spreadsheet you wish to be used in your lookup by clicking on the ellipsis (...) in the FileName field.
In this case it is our metadata document.
Now we need to configure the lookup. For this example choose FileName as the target column. Select
FileName from the drop down menu so that Data Sync matches based on the filename in the Excel file.
Now you can setup the Schema Map, so that the custom metadata columns from the Lookup map across to the SharePoint Columns.
Press the 'Compare A -> B' Button in the Toolbar to compare the source to the Target.
Data Sync will then display the results of the comparison. You can confirm that these are correct before synchronising by clicking onto the
+ 5 Record(s) Only in Source (A) ADD (5) to Target (B).
Synchronise and then
Start to begin the sync.
Once this has run through and completed, you can now go to your document library in SharePoint and view the documents that have been added, alongside their corresponding metadata.
Can't find the answers you're looking for? Contact our support team and we'll personally get back to you as quickly as we can.