Forum Discussion
Get all files from onedrive folder in an efficient way
- 6 years ago
Yes. In the SOURCE line of the query, change SharePoint.Files("http://blahblah") to SharePoint.Contents("http://blahblah")
You will be at the root of the sharepoint site. You'll have to navigate through to the desired folder, but the end result will ignore all other folders when your query runs.
- 6 years ago
Change your source to this:
Source = SharePoint.Contents("https://sharepoint_site_root_name", [ApiVersion = 15]),See if that helps.
I'm not sure why it would take a long time to browse, unless the folder you are accessing has hundreds or thousands of files in that folder. It does have to load the full listing of the folder you ultimately get a file(s) from.
Hi edhans,
I've changed source to include ApiVersion and now everything works super fast.
Thanks a lot!
Cool. I don't know exactly what the ApiVersion does, but I do know it limits how many files it pulls (low thousands). If using SharePoint.Contents() that shouldn't be an issue since an individual folder should not have thousands of files in general. So it stops PowerBI from pulling endlessly to get all of the file and folder names. It has a decent effect on SharePoint.Files, but apparently a huge effect on SharePoint.Conents()!