Microsoft OneDrive folder already exist

Hi all,

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.

Thanks in advance.

Hey @Siva_Nagarajan,

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.

1 Like

Hi @Jon ,

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.

Power Meter → PDA → SDA → BB → House Number

But the folder is not created in the strucure.

Hey @Siva_Nagarajan,

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.

1 Like

@Jon Okay. I’m not sure what is wrong in the workflow. why I’m not able to create nested folder structure based on the path given.

@Jon As I checked, sometimes the search has not returned the folder details even though they exist.

Hey @Siva_Nagarajan,

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.

1 Like

Hello @Jon ,

Thanks for your reply. Can you check my changes?

So, If we want to search only files? then I need to set the property to be true right?

Hey @Siva_Nagarajan,

You got it, I am not sure if the OneDrive API will do a recursive search though so there could still be more to do.

1 Like

@Jon The solution is not working. Please find the attachment

There I have PDA 29 folder. But it returns empty.

Hey @Siva_Nagarajan,

There could be a couple of things…

  1. The API search is not recursive (doesn’t include sub folders)
  2. The API is not returning anything because of the odd caching that OneDrive does

How long ago did you make the folder? As an example of how questionable OneDrive can be… I have made a folder called TEST

After 3 minutes I still can’t search for it.

If the UI is having problems it doesn’t look too good for the API, Once I am able to search for my folder I will take another look.

1 Like


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.

Hi @Jon ,

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.

Hey @Siva_Nagarajan,

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.

1 Like

Hi @Jon ,

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?

Hey @Siva_Nagarajan,

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.