Power Query Problems

Add File Author Metadata to an Excel Power Query Folder Import

Natalie TaylorNatalie Taylor Dec 2, 2026 868 views

Question details

Add each document's author to a Power Query table imported from a folder.

Add File Author Metadata to an Excel Power Query Folder Import
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A user imports a folder of files and wants to include the author stored in each document's properties.
Observed behavior
The Folder connector exposes standard file metadata, but its Attributes record does not normally include the document author.
Before you start

Identify the file types in the source folder and check whether they contain a populated Author document property. The PowerShell example below requires Windows, Microsoft Excel, and local XLSX files; it reads the folder itself, not subfolders.

Solution 1Recommended

Extract Excel file authors and merge them into Power Query

Use PowerShell to create an author lookup CSV, then join it to the folder query by full file path.

The Author document property is different from the file owner or the person who last modified the file. Other file types require a suitable document-property reader.

Run the script only on files you trust. It disables macros and link updates when opening the workbooks, but opening unknown files can still carry risks.

1
Create the author lookup

Open Windows PowerShell. Replace the two paths below with your source folder and a CSV location outside that folder, then run the script: $folder = 'C:\Files\Source' $csv = 'C:\Files\authors.csv' $excel = New-Object -ComObject Excel.Application $excel.Visible = $false $excel.DisplayAlerts = $false $excel.AutomationSecurity = 3 try { $rows = foreach ($f in Get-ChildItem -LiteralPath $folder -File -Filter '*.xlsx' | Where-Object { $_.Name -notlike '~$*' }) { $book = $null try { $book = $excel.Workbooks.Open($f.FullName, 0, $true) [PSCustomObject]@{ FullPath = $f.FullName; Author = $book.BuiltinDocumentProperties.Item('Author').Value } } catch { Write-Warning "Could not read $($f.FullName): $_" } finally { if ($null -ne $book) { $book.Close($false) } } } $rows | Export-Csv -LiteralPath $csv -NoTypeInformation -Encoding UTF8 } finally { $excel.Quit() [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($excel) }

2
Load the CSV into Power Query

In Excel, select Data > Get Data > From File > From Text/CSV, choose authors.csv, and select Transform Data.

3
Create a matching path column

In the folder query in Power Query Editor, select Add Column > Custom Column and create a column named FullPath with the formula [Folder Path] & [Name]. Make sure the paths match those in the CSV.

4
Merge and expand authors

Select the folder query, choose Home > Merge Queries, and select FullPath in both the folder query and the author lookup. Use a Left Outer join, select OK, then expand the merged column and select Author.

5
Load and maintain the result

Select Home > Close & Load. When files or author properties change, rerun the PowerShell script and then select Data > Refresh All in Excel.

Extract Excel file authors and merge them into Power Query
Check unmatched files: A blank Author after the merge can mean the property is empty, the script could not read the file, or its full path did not match. The example processes XLSX files in the specified folder only.
Free Microsoft Office alternative

Work with Excel author lists in WPS Spreadsheet

WPS Office is a free, lightweight alternative with a familiar interface and Excel format compatibility. Open your existing spreadsheets and work with a separately prepared file-author list while migrating your everyday spreadsheet work to WPS.

Review and organize a prepared file-author lookup alongside spreadsheet dataOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can Power Query get the document author from the Folder connector's Attributes column?

The standard Attributes record does not normally include the document author. Extract the property separately and merge the resulting lookup with the folder query.

Why should I merge on the full file path instead of the file name?

Files in different folders can have the same name. In Power Query Editor, use Add Column > Custom Column to combine [Folder Path] and [Name], then merge that value with the lookup's FullPath column.

Does refreshing the Power Query also update the author CSV?

No. Rerun the extraction script to update the CSV first, then use Data > Refresh All to reload and merge the latest values.

Will the PowerShell example read authors from Word or PDF files?

No. The example uses Excel to read the Author property from XLSX files. Word, PDF, and other formats need a reader or API that supports their document properties.

Why is an author's value blank after the merge?

The document may have no Author property value, the extraction may have failed, or the full paths may not match. Check the PowerShell warnings, the CSV, and the merge columns in Power Query Editor.