How to Export SharePoint Attachment Names to Excel or CSV
Question details
Extract the file names or URLs of attachments from a SharePoint list and export them into an Excel spreadsheet or a CSV file.

- Product
- SharePoint Online / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Generating a report or database of SharePoint list items that requires specific details and links for attached files.
- Observed behavior
- The default 'Export to Excel' feature in SharePoint does not include attachment names or URLs in the exported data file.
Ensure you have the necessary permissions (such as Site Owner or Administrator access) to run PowerShell scripts against your SharePoint environment or to create new Power Automate flows.
Use Power Automate to Add Attachment Links to a Column
Create a flow that automatically copies attachment names or URLs into a dedicated SharePoint list column, allowing you to export them normally.
This is the most accessible method for users who prefer a visual interface without writing code. By moving the attachment data into a standard text or hyperlink column, SharePoint's native Export to Excel function can capture it.
Navigate to your SharePoint list and create a new column named 'Attachment Details'. Set its type to 'Multiple lines of text' or 'Hyperlink'.
Open Power Automate and create a new automated cloud flow triggered by 'When an item is created or modified'.
Add the 'Get attachments' action and pass the List Name and Item ID from the trigger to fetch the attachment details from the list item.
Add an 'Update item' action. Use an expression or dynamic content to write the retrieved attachment DisplayName or AbsoluteUri into your newly created 'Attachment Details' column.
Return to your SharePoint list. Once the flow has updated the column, click 'Export' > 'Export to Excel' or 'Export to CSV' to download the list with the attachment details included.

Extract Attachment Names to CSV using PowerShell
Run a PowerShell script using the PnP PowerShell module to retrieve all list items, loop through their attachments, and export the names directly to a CSV file.
View and Analyze Your Exported SharePoint Data in WPS Office
Once you have successfully exported your SharePoint list and attachment details to a CSV or Excel file via Power Automate or PowerShell, you need a powerful spreadsheet tool to manage the data. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office that lets you view, edit, and analyze your exported lists seamlessly.
- 1. Open WPS Spreadsheet: Launch WPS Office and click on 'Spreadsheet' on the main dashboard.
- 2. Import your CSV or Excel file: Click 'Menu' > 'Open' and locate the CSV or Excel file you exported from SharePoint.
- 3. Analyze your data: Use WPS Spreadsheet's filtering and formatting tools to organize your SharePoint attachment URLs and list item details.

Frequently Asked Questions
Why doesn't the default SharePoint Export to Excel include attachments?
SharePoint's built-in Export to Excel feature only exports primary column values. Because attachments are stored in a separate internal collection linked to the list item rather than a standard text column, the default export tool ignores them.
Can I export the actual attachment files from SharePoint instead of just the names?
Yes, but not through standard list exports. You would need to use PowerShell scripts to download the physical files to a local directory, map a network drive to the hidden SharePoint attachments folder, or use third-party migration tools.
Is there a way to export SharePoint attachment links without writing any code?
Yes. Power Automate provides a no-code visual interface to extract attachment URLs and update a custom list column. Once that custom column is populated, you can export it to Excel directly from the SharePoint list menu without writing any PowerShell scripts.
What happens if a list item has multiple attachments?
If an item has multiple attachments, your PowerShell script or Power Automate flow must be configured to join or append the file names together (e.g., separated by a comma or semicolon) before writing them to the CSV or custom column. Otherwise, only the first attachment or the last attachment might be recorded.




