Exporting An Excel Table To A SharePoint List - KING OF EXCEL

Tuesday, October 13, 2020

Exporting An Excel Table To A SharePoint List

 

Exporting An Excel Table To A SharePoint List

What Is SharePoint?

As the name might suggest, it’s a place to share stuff.

It’s a browser based platform from Microsoft that can house all the content (data, files, folders, photos, documents etc.) related to your work to make it easier to share and collaborate with others on the same work.

My-Basic-SharePoint-Site Importing and Exporting Data from SharePoint and Excel

You can think of it as an internal company website (intranet) that can help improve your organization’s data management. A sort of Wikipedia style server or information portal. It’s also a bit like OneDrive in that it can store and manage your files in the cloud, but with some more advanced collaboration features.

I set up my SharePoint site quickly and didn’t bother to edit or customize anything. This is what you get straight out of the box.

There’s a lot of customization possible, but I’m just using it to store a couple data lists so didn’t think it was worth spending any time on.

How Do I Get SharePoint?

SharePoint doesn’t come with any of the Office 365 Home products. It’s really only intended for business use so it’s only available with an Office 365 Business account subscription.

In fact, you’ll have to shell out for the Office 365 Business Premium account if you want to use SharePoint. It’s not available with the regular business account.

What Is A SharePoint List?

A SharePoint list is similar to an Excel Table, it’s a container for data.

SharePoint lists allow you to store data in list format with rows and columns.

You can use a list to house all your customer contact details, employee details, product pricing etc. If you can organize the data into a table structure, then it can be stored in a SharePoint list.

Unlike Excel tables, the columns in a SharePoint list allow you to set a column as a certain type of data like text, number, date, hyperlink etc… A SharePoint list can even contain attachments so you could attach a photo to each employee in your employee details list.

Creating A New List In SharePoint

Creating a new list in SharePoint is easy.

Creating-a-New-List-from-SharePoint Importing and Exporting Data from SharePoint and Excel

From the homepage of your SharePoint site, press the New button then choose List from the options. Give the list a name and description and press the Create button.

New-SharePoint-List Importing and Exporting Data from SharePoint and Excel

You will now have a blank SharePoint list!

All SharePoint lists contain a Title column, and this should usually be reserved for a field that contains unique values.

You can customize your new list by adding columns, assigning data types to each column and then adding data to the list.

The new list might appear in your site navigation menu, but if not you can use the Site Contents menu item to navigate back to the list from any place on your SharePoint site.

Exporting An Excel Table To A SharePoint List

If your data already exists in Excel, then there is an easier way to create a new SharePoint list.

You can export data from Excel to SharePoint. This way, you can avoid the tedious task of creating and assigning data types to columns.

If your data already has column names in Excel, then these are also exported to your new SharePoint list. The Export wizard will also guess what SharePoint data types to use for the columns based on the data.

Create An Excel Table For The Data

Employee-Excel-Table Importing and Exporting Data from SharePoint and Excel

First, the data is going to need to be in a table format.

Insert-Table Importing and Exporting Data from SharePoint and Excel

Select the data then go to the Insert tab and choose Table. Another way to turn your data into a table is to use the Ctrl + T keyboard shortcut.

Name-Your-Table Importing and Exporting Data from SharePoint and Excel

Make sure you name the table after by going to the Table Tools Design tab and giving it a new name in the Properties section.

Export The Excel Table To A SharePoint List

Export-Table Importing and Exporting Data from SharePoint and Excel

Select the table and go to the Table Tools Design tab and select the Export command then choose Export Table to SharePoint List.

Export-Table-to-SharePoint-List-Wizard-Step-1 Importing and Exporting Data from SharePoint and Excel

The first step in the Export to SharePoint List wizard.

  1. Enter the URL for your SharePoint site.
  2. Check the box if you want to create a read-only connection to the SharePoint list. This means when you add data to the list on your SharePoint site, the new data will show up in your Excel table when you right click and refresh the table.
  3. Enter a Name for the new list.
  4. Enter a Description for the new list. This is an optional entry.
  5. Press the Next button to review the data types selected before exporting.

Your SharePoint URL should be something like https://yourcompany.sharepoint.com/sites/yoursitename.

Export-Table-to-SharePoint-List-Wizard-Step-2 Importing and Exporting Data from SharePoint and Excel

In step 2 of the export wizard, review the data types for each of the columns in the data. If a selected data type is incorrect, you’ll need to cancel the export and either fix the key cell in the table or change the entire column of data in the table.

When you’re happy with the data types in the export wizard, press the Finish button to complete the export.

How big the list is will affect how long the export takes. A handful of rows will be near instant but a couple thousand rows can take several minutes to export.

Export-Success Importing and Exporting Data from SharePoint and Excel

When the export process completes successfully, you’ll get a pop up notification with a link to the location of the new list.

You can click on this link and the SharePoint list will open in your default browser. Alternatively, you can find the list from the Site Contents navigation menu.

Refreshing An Excel Table With A Read-Only Connection To A SharePoint List

In the export table wizard there was an option to create a read-only connection to the new SharePoint list.

If you select this option then you’ll be able to refresh your Excel table with any new or changed data from the SharePoint list.

Refresh-Excel-Table Importing and Exporting Data from SharePoint and Excel

Select the table and go to the Table Tools Design tab and press the Refresh button or right click on the table and select Refresh from the menu.

The data in the Excel table will be updated with the latest data from the SharePoint list.

Exporting A SharePoint List To An Excel Table

You can also move data the other way by exporting from SharePoint to Excel.

Export-SharePoint-List-to-Excel Importing and Exporting Data from SharePoint and Excel

There’s a big Export to Excel button in each list.

query-iqy-file Importing and Exporting Data from SharePoint and Excel

Press this button and the browser will download a query.iqy file.

Import-Data-Menu Importing and Exporting Data from SharePoint and Excel

Open this file and Excel will launch and prompt you to choose where to load the data (Table, Pivot Table or Pivot Chart) and choose the location to load it (an existing worksheet, new worksheet or new workbook).

This is actually the exact same read-only setup that was an option when exporting from Excel. If you missed enabling that option, no worries because you can achieve the same thing by exporting from your SharePoint list.

Importing A SharePoint List To Excel With Power Query

Power query can be used to connect to all sorts of data sources and SharePoint lists are one of them.

This will give you more control over which data in the list you import as compared to creating a read-only connection to the SharePoint list.

Create A SharePoint Power Query

Get-Data-from-SharePoint-List Importing and Exporting Data from SharePoint and Excel

To create a new SharePoint list query, go to the Data tab ➜ select Get Data ➜ choose From Online Services ➜ choose From SharePoint Online List.

This option is also available under the From Other Sources menu as From SharePoint List.

You will be prompted to enter the URL to the SharePoint site. This should be of the format https://yourcompany.sharepoint.com/sites/yoursitename. Then you can press the OK button.

Enter-SharePoint-Site-URL Importing and Exporting Data from SharePoint and Excel

This will open the power query navigator preview where you can select the list you want to import. Once selected, a preview of the list will show on the right.

A large number of columns in the data preview will look unfamiliar. This is because SharePoint lists contain a lot of extra columns even if they aren’t being used.

For example, every SharePoint list will have an ID column which is a unique identifier automatically created for each row in the list.

You will need to edit the query slightly to avoid importing all these unfamiliar columns. Press the Transform Data button to open the power query editor.

Remove-Other-Columns Importing and Exporting Data from SharePoint and Excel

There are a lot of extra columns, so it will usually be easier to select the columns you want to keep (hold the Ctrl key to select multiple columns). Then right click on any of the selected column headings and choose Remove Other Columns from the menu.

You can also do any other type of data transformation available with power query if you would like.

Close-and-Load-Power-Query-Editor Importing and Exporting Data from SharePoint and Excel

Once you’re finished with the query, you can save it and load the data into Excel. Go to the Home tab in the power query editor and press the Close & Load command to save the query and load the data into an Excel table in your workbook.

Importing Files From A SharePoint Document Library Or Folder With Power Query

SharePoint can store more than just lists, it can also store all types of files in a document library.

You can use use power query to import and combine data from multiple data files like Excel workbooks or CSV’s.

What Is A SharePoint Document Library Or Folder?

A SharePoint document library is very similar to a folder on your computers hard drive. It’s a place to store all your related files.

You might set up a document library for all your monthly sales files.

Sales-Document-Library Importing and Exporting Data from SharePoint and Excel

Here I have a document library called Sales and in a folder called 2018Q1 in which I have 3 Excel workbooks.

Sales-Data Importing and Exporting Data from SharePoint and Excel

Each file has sales data by day for the particular month.

Export A Folder To Excel

If you click on the Export to Excel button found in the SharePoint folder this will download a query.iqy file.

When you open this file it launches Excel and creates a read-only connection to the list of files in the folder. You can refresh this just like when exporting a SharePoint List to an Excel Table.

This table only contains the names of files and not the actual contents of the files. There is a handy clickable hyperlink for each of the file or folder names. This will open up the SharePoint file or folder.

Export-Folder-to-Excel Importing and Exporting Data from SharePoint and Excel

Create A From SharePoint Folder Query

You’ll need power query if you want to import and combine the data inside all the files.

Get-Data-from-SharePoint-Folder Importing and Exporting Data from SharePoint and Excel

To create a SharePoint Folder query go to the Data tab ➜ select Get Data ➜ choose From File ➜ choose From SharePoint Folder.

Now you’ll need to input the site URL (not the folder URL).

Navigation-Preview-of-Files Importing and Exporting Data from SharePoint and Excel

The Navigation preview will show a list of all files in the site and you’ll need to use power query to filter down to the files you want. Press the Transform Data button.

Filter-on-Desired-Folder Importing and Exporting Data from SharePoint and Excel

Filter on the Folder Path column to the desired folder. Then further filter on any file Name or Extension to get exactly the files you want.

Expand-and-Combine-File-Contents Importing and Exporting Data from SharePoint and Excel

When only the files you want to import and combine are left, click on the Combine Files toggle in the Content column heading.

Combine-Files Importing and Exporting Data from SharePoint and Excel

Power query will import and combine the files based on a sample file. You can then select which sheets to import and view a preview of the data on the right side. Press the OK button to combine the files.

You can then Close & Load the query to import all the data. Now if you add a new monthly sales files to the folder and refresh the query, the new file’s data will be included in the query’s output.

Conclusions

SharePoint is a great place for storing files for collaboration and data that’s shared throughout the company.

But it might not be the best place for further using or analyzing the files or data.

That’s ok though, SharePoint and Excel are very well integrated. It’s easy to push and pull data from SharePoint to Excel.

You can quickly get data using the export options in either Excel or SharePoint. If you’re comfortable with power query, you can even use that.

SharePoint-Folder-Site-URL Importing and Exporting Data from SharePoint and Excel

Power-Query-Navigator-Preview Importing and Exporting Data from SharePoint and Excel

#evba #etipfree #eama #kingexcel 

Popular Posts