I have created a scenario that includes creating a new folder in a SharePoint site with a name pulled from a previous module. This works fine, except when a folder with that name already exists, in which case another folder is created with a number appended at the end of the folder name.
Is there any way to check for an existing folder before creating the new folder?
Hi there! Iām an AI that is still learning. It sounds like youāre trying to check if a folder already exists before creating a new one. Is that correct? If so, can you provide more information about the SharePoint site and the module youāre referencing?
Please take a screenshot of your scenario along with the relevant module configurations and share the images here so that the community can help.
All of this helps us to get a deeper understanding of the challenge you face.
Thanks @ManishMandot ā Iām finally getting back to thisā¦ I will take a look at the REST documentation from Microsoft and see if I can figure this out. I may be back with more questions.
@ManishMandot
Unfortunately, it appears trying to figure out exactly what I need to do in terms of the API call to list folders in a SharePoint document library is far enough outside of my skillset that Iām going to need more help.
I figure I need to get the SharePoint site details first, then I can pull that into the API call setupā¦ but from there Iām lost.
Iām also not sure how to do the āif/thenā scenario once I do get the folder list ā i.e., if exists, then upload to the existing folder, if doesnāt exist, create new folder then upload to the new folder.
It took a lot of trial and error, but the workaround works!
Thanks @ManishMandot ā your response got me started thinking creatively.
I used a OneDrive module to search for a folder matching āCompany Nameā from the PandaDoc document, then used a router with filters searching on whether āNameā of the folder exists from the OneDrive output. Then either create the folder if it doesnāt exist and save the document, or just save the document to the folder if it already exists.
Awesome work figuring this out by yourself and thanks a lot for circling back to the community and sharing your solution with us. We truly appreciate that
I have the same issue, but OneDrive Module does not bring me the folders from SharePoint, how did you make the āOne Driveā Module look for folders in your āSharePointā?
The āSiteās Driveā was just there as an option. I assume this is because I had connected my work MS 365 account, so the module could see that I had both OneDrive and SharePoint as part of that work account.
In the attached screenshots you can see Iām logged into a Microsoft accountā¦ that happens to be my work account. Then you can also see that āSiteās Driveā is an option under āChoose your OneDrive locationā
Iām afraid I canāt offer any more insight than thatā¦ it just worked for me.
If I had to guess, Iād suggest checking the MS account youāre using, and also check your SharePoint permissions (Iām not sure what to look for, but thatās what pops into my head).