Forum Discussion
One drive file and folder path to be made dynamic
Hiya good people,
I am working with a couple of folders and the files therein - which are saved on onedrive, syncing between two machines.
But the usernames and onedrive folder path names are different on the two machines - so the query breaks on one of the two machines, if I dont change the file/folder path manually on each machine.
I tried to solve the problem using sharepoint.contents but that makes the loading extremely slow even on fast machine.
Is there anything in PQ like the os.walk in python?
Thanking in anticipation
best regds.,
8 Replies
- christinepaytonMost Valuable Professional
I'm not quite sure what you're looking for here, but if I were pulling files from two different OneDrives, and they had the same columns etc, I would just do one query for each (with no transformations) and then append them together in a new query, then add the transforms there.
You can also use parameters in your query, so you could have a parameter for the site path, but I'm not sure that's useful to you here.
- monojchakrabResolver III
Hey christinepayton - I am sorry I was not able to communicate clearly. Let me attempt again :
1. I have a file called file.xlsx and and a folder which has all the source/raw files. Let us call it sourcefolder.
2. file.xlsx and source folder are inside my onedrive folder
3. The onedrive account is the same on both the computers
4. But the paths are different :
a. One one machine its like c:\users\mmchak\onerdrive--etc & on the other :
b. c:\users\manoj\onedrive<followed by something else>
5. While the onerdrive account is the same, somehow the onedrive folder name shows up as different on the 2 different machines
6. Hence, using a parameter does not help since the onedrive syncs between the 2 machines and what I have as a folder path as parameter on one machine becomes the same for the 2nd one - i) so, it works for one machine on which the file/folder path are correct but not for the other one ii) If I am accessing the same file on the 2nd machine, I need to change the path set as a parameter manually
7. I was looking to make this access dynamic - so that for wach respective machine, the file and folder path are picked up dynamically
Not sure if this clears the air - happy to expound further...
Appreciate and best regds.,
- christinepaytonMost Valuable Professional
Oh - just change the path that it's looking for the file to the web-synced OneDrive URL. All of the OneDrive folders are synced up to M365, so if you connect to it in the cloud instead of the local copy, it will always be the same.
Here are a couple videos on how to change the source from local to SharePoint (or OneDrive - concept is the same) - one for changing individual file references and one for folder connector references.