I’m using the OneDrive node to upload files to do that I’m creating a folder path at runtime. something like
pda/sda/bb/housenumber. The first time the folders are created successfully. But When I try to create once again a new folder called pda/sda2/bb2/housenumber2 the OneDrive node returns an error called ‘Folder Name Already Exist’.
I know the pda folder is there already, but I don’t have any idea how to handle this issue.
If the folder already exists just need to continue the flow or any other better solution will be helpful.
What about using the continue on fail option under the nodes settings? You could also try listing the folder before creating it and if it doesn’t exist already create it.
I have used that in my workflow please find. Now, The search is not working. I’m trying to create the folder only if it’s not there. I’ll get the folder structure dynamically based on some logic
I need to create the nested folder. So, I used the parent and children concept. Once generated the parent folder again I’m trying to use the parentId of the created folder from the search folder node and add it to the parentId.
But what happens is the folders are created outside of the parent.
For some reason I can’t access Onedrive at the moment, It could be that the parameter is not correct as soon as I am able to access my account I will have a proper look.
So I have managed to get logged into it, It looks like the problem is likely to be with how the workflow is built and limitations with the Node / OneDrive API.
Looking at the search options it doesn’t search for folders but instead looks for files, It looks like you could add something like AND isDocument=false to the end of the search query.
It might be worth adding a en empty file to the path or adding a longer wait for the OneDrive API to pick up the changes.
I created the folder yesterday. Even I’m not able to get it. Earlier I thought its taking little time to create folders. That’s why I added wait with 10 seconds.
It looks like for me using that search term works for sub folders but not root level folders. Now I have given it more time though I am able to create the folders.
Because of how flakey the calls are it might be worth just making the folders and not checking then turning off the error checking and manually handling it as needed.
Right now I’m looping the folder structure to create nested folders. Is there any possibilities to hold the created folder and its ids as key value pair. So, that I can use it some places without search the folders that are created in the current workflow.
For example: I need to upload files in the last sub folder. If I have the folder name and ids. I’ll just use the last created folder id to upload files.
Also for me root folder search is working. The sub folders search are working sometimes only. That’s the reason my workflow looks ugly now. I handled everything manually.
You could store the IDs in a database or something like a Google Sheet and look up the ID from there to use it. You could probably just make the folders as well and ignore the errors if you get any.
Now, I’m just storing the created folder and its ids to json and using it for future reference. I found a strange issue while working with Microsoft Onedrive. The search folder returns the already deleted folder. Can you check this?
We will return whatever the API gives us so if Microsoft are still returning the deleted folder we don’t really have any control over that, I suspect it is a bit like when a folder is added and you can’t see it in the API or search for it in the OneDrive console for a while.