Stop 02 · Connecting to DataTopics · 4/8

Folder, Web and SharePoint Connectors

Part of the Power BI Roadmap

In short

Real data rarely arrives as one neat file. It comes as a folder of monthly exports, a table on a web page or files in a team's SharePoint site. These three connectors handle all of that.

The Folder connector combines many files with the same layout into one table, the Web connector pulls tables from web pages or APIs, and the SharePoint Folder connector reads files stored in a team's SharePoint site.

The jaadu empties a stuffed home letterbox, glances at a public notice board, then collects a parcel from an office mail room counter.

Think of it like this

Three ways to collect post

A folder is your own letterbox where many envelopes pile up. The web is a public notice board you read from outside. SharePoint is the office mail room: shared, locked and managed. Power BI has a connector for each, and each knows how to open its kind of post.

Watch it happen

Folder vs SharePoint Folder

Folder

  • Reads a folder on your PC or a network drive
  • Needs a gateway for scheduled refresh in the Service
  • Path breaks if the drive letter changes

SharePoint Folder

  • Reads every file in a SharePoint site
  • Refreshes in the Service without a gateway
  • You filter to the right subfolder by path

If the files already live in SharePoint or OneDrive for work, use the SharePoint Folder connector. It makes cloud refresh much simpler.

The big ideas

What you need to know

Folder lists files

It returns one row per file with Name, Extension, Date modified and a binary Content column to combine.

Web reads pages and APIs

Point it at a URL. It finds HTML tables on a page, or reads JSON returned by an API.

SharePoint needs the site URL

Give the site address, like https://yourcompany.sharepoint.com/sites/Sales, not the full path to a file.

Combine Files

For folders, the Combine Files button builds helper queries that stack all files into one table.

See it in code

Walk through the code

m
1let2    Source = SharePoint.Files(3        "https://yourcompany.sharepoint.com/sites/Sales",4        [ApiVersion = 15]5    ),6    Monthly = Table.SelectRows(7        Source,8        each Text.Contains([Folder Path], "/Monthly Exports/")9            and [Extension] = ".csv"10    )11in12    Monthly13 14// Local folder: Folder.Files("D:\Exports\Monthly")15// Web API:      Json.Document(Web.Contents("https://api.example.com/rates"))

1/3SharePoint.Files reads every file in the site's document libraries.

List every CSV in the Monthly Exports folder of a SharePoint site. Folder.Files returns the same columns for a local folder.

Save yourself the pain

Common mistakes

Oops

Pasting the full link to one SharePoint file into the SharePoint Folder connector.

Do this instead

Enter only the site URL, then filter by Folder Path and Name in Power Query.

Oops

Dropping a summary file or a ReadMe into the folder you combine.

Do this instead

Filter on Extension and Name so only the real data files are combined.

Your mission

Try all three

~30 min

Quick check

What URL should you give the SharePoint Folder connector?

Go deeper

  1. 1Put a few monthly CSV files in a folder and combine them in one step.
  2. 2Pull a public table from a web page with the Web connector.
  3. 3Learn why SharePoint is preferred over a laptop folder for files that must refresh in the Service.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge