Forum Discussion
How to change source data from local drive to One Drive
- 8 years ago
Hi coolshib
I am assuming your source files are Excel files.
You will have to do two things:
- Find the appropriate URL pointing to your file on OneDrive
If it's OneDrive for Business look here
If it's OneDrive Personal see this post - Change the step of your query that connects to the file from something like this
=Excel.Workbook(File.Contents("C:\dummy\file.xlsx"),null,true)to something like this (OneDrive for Business)=Excel.Workbook(Web.Contents("https://XXXXX-my.sharepoint.com/personal/USER_XXXXX_onmicrosoft_com/Documents/folder/file.xlsx"),null,true)or something like this (OneDrive Personal)= Excel.Workbook(Web.Contents("https://onedrive.live.com/download?resid=XXXXXXX&authkey=YYYYYYYYYYY&em=x&app=Excel"), null, true)
The appropriate credentials would be needed for either connection.
Does that help?
Regards,
Owen
- Find the appropriate URL pointing to your file on OneDrive
Good afternoon OwenAuger,
I've the same problem, but then the orther way around. My current file is a CSV saved on a onedrive of an old collegue, i can't reach this with my credentials. I've fot the same file on a local drive.
In the quiery editer - data source settings - i can only change to a URL (see screenshot). I'm not sure how to get the source to my local drive. Are you able to help?
Thanks in advance
Hi lpronk
You will have to edit the code in the Advanced Editor.
You will want to change Web.Contents to File.Contents.
There will likely be a step like this:
=Excel.Workbook(Web.Contents("https://XXXXX-my.sharepoint.com/personal/USER_XXXXX_onmicrosoft_com/Documents/folder/file.xlsx"),null,true)
which you should change to a step like this:
=Excel.Workbook(File.Contents("C:\dummy\file.xlsx"),null,true)