Oct 25 2023 01:47 PM
I have a document library with a folder that represents every state in the United States. Within each folder, I need to create a folder for each one of our theaters. Within each theater folder needs to be the same additional folders and even more folders within those folders.
I found a video saying to user Power Apps to create a flow to bulk create the folders but I wanted to see if anyone knows of any other way? Is there a way to import an Excel document with all of the folder structure in place? Thanks in advance!
Oct 26 2023 12:04 AM
Hi @Beth_Culpepper,
you can try to do this by using PowerShell:
# Import the CSV file
$CSVFile = Import-Csv "C:\Path\To\CSVFile.csv"
# Get the document library
$Library = Get-PnPList -Identity "DocumentLibraryName"
# Create each folder in the document library
ForEach($Row in $CSVFile) {
$FolderURL = $Library.RootFolder.ServerRelativeUrl + "/" + $Row.State + "/" + $Row.Theater + "/" + $Row.AdditionalFolder + "/" + $Row.Subfolder1 + "/" + $Row.Subfolder2
Resolve-PnPFolder -SiteRelativePath $FolderURL | Out-Null
}
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)