Forum

Source change from ...
 
Notifications
Clear all

Source change from local drive to SharePoint for existing Query

3 Posts
2 Users
0 Reactions
74 Views
(@wrighto)
Posts: 5
Active Member
Topic starter
 

Hi, I'm having a bit of issue with source changes.  We are losing the local drives so we are slowly moving all folders to OneDrive/SharePoint.

From local drive

G:FLKWarehouseStockABC AnalysisPick Query combined.xlsx

To the path i can access OneDrive

C:UserswrightOneDrive - CLogisticsDocumentsGeneralStockFLKABC AnalysisPICK DATA

All seems fine for me and other users can see the folders but they can't refresh the Query (being linked to my user).

I have then tried multiple ways via logging in to One Drive and Share Point, copying the path from there so it doesn't keep my details.

For Queries accessing individual spreadsheets, i believe i've worked it out and no error.

= Excel.Workbook(Web.Contents("https://clogisticsoffice365.sharepoint.com/sites/Europe-CL-GB-C3/Shared%20Documents/General/Stock/FLK/ABC%20Analysis/

But i'm struggling with the Query that references a Folder (containing multiple months sheets and new ones being added regularly)

Current path that i need to amend is:

= Folder.Files("C:UserswrightOneDrive - CLogisticsDocumentsGeneralStockFLKABC AnalysisPICK DATA")

The path to the folder i need to amend to is below but when i tried to replace it, it errored.

https://clogisticsoffice365.sharepoint.com/:f:/r/sites/Europe-CL-GB-C3/Shared%20Documents/General/Stock/FLK/ABC%20Analysis/PICK%20DATA

Then i tried to create a new Query directly from SharePoint, the source appears slightly different, so i tried to replace it with this one as well.

= SharePoint.Files("https://clogisticsoffice365.sharepoint.com/sites/Europe-CL-GB-C3/", [ApiVersion = 15])

It sort of accepted it in Source but the steps afterwards errored.

I can't tell what else to change in Advanced Editor so i don't have to create the Query from scratch, as there are multiple amendments in Transformation File.

Is there an easy way to do the change without creating the Query from the start?

Thanks

Olesea

 
Posted : 18/05/2022 11:19 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Olesea,

The process for getting files from a local folder vs a SharePoint folder are different, as you have found. Because of this you can't simply edit the source file. Instead you have to recreate the query using the From SharePoitnt Folder connector. I would create a new query that gets your data, then you can paste in the code from your original query from the point where you start the transformations.

If you're getting errors then they should give you some clues as to what the issue is so you can work through them.

Hope that points you in the right direction.

Mynda

 
Posted : 19/05/2022 12:24 am
(@wrighto)
Posts: 5
Active Member
Topic starter
 

Thanks Mynda.  I will try and do that, hoping i don't have to recreate the whole Query from scratch as it contained so many steps i can't even remember what was what....

 
Posted : 19/05/2022 7:44 am
Share: