We have a sharepoint site with multiple external organisations who each have access to one folder only. On some occasions, our users will want to share the same document with all organisations. Is there a way they can do this with one upload rather than multiple? In other words almost a drop down menu where they can select the multiple organisation folders they want to share these documents with.
Just at the top of my head, this can probably be achieved via a custom column in the Document Library and also Power Automate to do the file copying.
Document Library changes: Add a new column to store list of organization values
Power Automate Flow
- Trigger - When a file is created
- Get custom file property that you created earlier which is the list of organization values
- Loop through the values in the custom file property
- For each value, "Copy File" to respective document library.
Something like below:
You can upload the same document in multiple folders using the PnP Powershell below. PnP Powershell code:
$SiteURL = "https://yourdomain.sharepoint.com/sites/xyzax-version1/"
$SourceFilePath ="C:\PnP powershell.txt"
$DestinationPath = Import-CSV -path "C:\test.csv" -Header("DestinationPath") #Site Relative Path of the Library
#Get Credentials to connect
$Cred = Get-Credential
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#powershell pnp to upload file to sharepoint online
foreach ($Url in $DestinationPath )
Add-PnPFile -Path $SourceFilePath -Folder $Url.DestinationPath
Here are steps:
1.Enter all individual employee folders URL in a .csv file.
If the answer is helpful, please click "√" on the left panel of the answer and kindly upvote it.