Hi @Tristan,
Thank you for posting in this community.
First of all, I'm sorry that we don't have the option to download multiple attachments for multiple selected items in the list's interface. SharePoint's lists are important for recording data rather than saving files, so it weakens the ability to download files.
We suggest that you can make suggestions on this SharePoint Feedback portal for downloading All Attachments from Multiple Selected Items in a SharePoint List. Your contribution will be highly appreciated.
Downloading attachments for individual items is doable:
To download attachments of a particular list item, open the item in view or edit mode, right-click on each attachment, and choose “Save link as” from the browser context menu. The file has a .htm
extension, but you can choose to open it with office software (Word, Excel, etc.).
Based on your description, you may be wanting to get certain items in the list based on their values in a certain column. So, I'll cover using Power Shell and Power Automate to download attachments. However, both are a bit complicated, and you can choose either one.
First, we can use PowerShell to filter the items based on the column value and get their attachments.
1.Install the PnP PowerShell Module for SharePoint Online
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
2.We need to write CAML to add our filters.
For example, the value of the choice column named ProjectStatus is Completed.
#CAML Query to Filter List Items.
$Query = "<View><Query><Where><Eq><FieldRef Name='ProjectStatus' /><Value Type='Choice'>Completed</Value></Eq></Where></Query></View>"
You can refer to this article to learn CAML Query, and then write a Query that meets your requirements.
SharePoint Online: How to Use CAML Query in PowerShell?
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
3.Integrate your query into PnP PowerShell by downloading the attached files.
#Set Parameters
$SiteURL = "https://YOUR DOMAIN.sharepoint.com/sites/YOUR SITE NAME"
$ListName = "YOUR LIST NAME"
$DownloadPath = "C:\Temp\YOUR DOWNLOAD PATH"
$ClientID = "YOUR CLIENTID"
# Connect to SharePoint Online site
Connect-PnPOnline -Url $SiteURL -Interactive -ClientId $ClientID
#CAML Query to Filter List Items
$Query = "YOUR QUERY"
#Get All List Items matching given query
$ListItems = Get-PnPListItem -List $ListName -Query $Query
#Iterate through List Items
ForEach($Item in $Listitems)
{
#Get Attachments from List Item
$Attachments = Get-PnPProperty -ClientObject $Item -Property "AttachmentFiles"
#Download All Attachments from List item
Write-host "Downloading Attachments from List item '$($Item.ID)', Attachments Found: $($Attachments.Count)"
#Create directory for each list item
$DownloadLocation = $DownloadPath+$Item.ID
If (!(Test-Path -path $DownloadLocation)) { New-Item $DownloadLocation -type Directory | Out-Null }
$Attachments | ForEach-Object {
Get-PnPFile -Url $_.ServerRelativeUrl -FileName $_.FileName -Path $DownloadLocation -AsFile -Force
}
}
Reference: SharePoint Online: Download Attachments from List using PowerShell
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Secondly, we can create a stream through Power Automate to get the attached files.
Step 1: Create a Flow in Power Automate
- Build an instant cloud flow
- Select "Manually trigger a flow"
- Please close "New designer" Feature.
Step 2: Add a “Get Items” Action.
Select and add the Get Items flow action, and provide the Site Address, List Name, and Filter query condition. Select and add the Get Items flow action, and provide the Site Address, List Name, and Filter query condition.
You can follow this article to learn more about filter query syntax and then define your filter queries.
How to Use Power Automate Get Items Filter Query + 8 Examples
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Step 3: Add a “Get Item” Action
In the ID section select the ID you obtained in the step 2.
Step 4: Add a “Get Attachments” Action
In the ID section select the ID you obtained in the step3.
Step 5: Add a “Get Attachment Content” Action
In the ID section select the ID you obtained in the step 3.
In the File Identifier section select the Id you obtained in the step 4.
Step 6: Add a “Create file” Action Step 5: Add a “Create file” Action
Save the attachments you get to the document library, after that we can download the files to your local computer.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.