View Full Version : Reading files from a OneDrive for Business folder

2016-07-15, 01:58 AM
I'm trying to read in a folder of files - this would be easy if it was a windows folder, but it's in OneDrive for Business.

I can read one file by pasting the right URL into the From Web dialog. I can see it converts it into:

Csv.Document(Web.Contents("https://[a lengthy onedrive file url]"),[Delimiter=",", Columns=16, Encoding=65001, QuoteStyle=QuoteStyle.None])

But how to loop over the files?

I've tried From Folder, and pasted in the OneDrive folder URL. It won't validate - the ! error is:

The folder path must be a valid absolute file path

I've tried From Web and pasted in the OneDrive folder URL. It shows an Unable to Connect error :

Details: "The input URL is invalid. Please provide a URL to the file path on SharePoint up to the file name only (with no query or fragment part)."

I've tried SharePoint.Contents - it lets me Authorize, then I get an error:

DataSource.Error: SharePoint: Request failed: The remote server returned an error: (400) Bad Request.

Google didnt turn up anything.

Does anyone know how to get this working?