logo
search
SharePoint Document Issues

How to Retrieve Custom Field Values for SharePoint File Versions

Partner EditorPartner Editor Oct 9, 2026 868 views

Question details

The user needs to retrieve historical custom field values associated with specific file versions in SharePoint using the REST API.

How to Retrieve Custom Field Values for SharePoint File Versions
Product
SharePoint
Device & OS
not provided
Scenario
Developing or integrating a solution that reads historical custom metadata from previous SharePoint file versions.
Observed behavior
Expanding ListItemAllFields or FieldValuesAsText on a file version returns the current item's fields instead of the custom fields for that specific version.
Before you start

Ensure you have the appropriate site collection administrator or developer permissions to run SharePoint REST API queries and access version history.

Solution 1Recommended

Use Separate Requests for List-Item Versions

Make targeted REST API calls to the list-item version endpoint rather than relying on file version expansion.

Because SharePoint treats file versions and list-item field versions independently in the REST API, expanding ListItemAllFields on a file version object defaults to the current metadata state. To retrieve historical metadata, you must query the list item's version history directly.

1
Get File Version Identifier

Query the SharePoint file to retrieve the specific file version identifier (VersionId) you want to investigate.

2
Locate List-Item Version Endpoint

Construct a REST API request targeting the list item's versions directly, typically using _api/web/lists/getbytitle('ListName')/items(ItemId)/versions.

3
Request Custom Fields Explicitly

Filter or select the specific VersionId in your query to extract the historical custom field values associated with that exact version.

Use Separate Requests for List-Item Versions
Check API Behavior: REST API endpoints and behaviors can vary slightly between SharePoint Online and SharePoint Server (on-premises). Always consult the specific Microsoft Learn documentation for your environment.
Free Microsoft Office alternative

Manage Your Documents Seamlessly with WPS Office

While you troubleshoot advanced SharePoint REST API configurations, consider WPS Office as a lightweight, comprehensive alternative for your everyday document creation and editing needs. It offers high compatibility with Microsoft Office formats without the hefty price tag.

  1. 1. Download the Installer: Visit the official WPS website and click 'Download WPS Office Free'.
  2. 2. Install WPS Office: Run the downloaded installer and follow the quick on-screen instructions.
  3. 3. Open Your Documents: Easily open your existing .docx, .xlsx, and .pptx files directly in WPS Office with zero formatting loss.
Highly compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight application that runs smoothly on Windows, Mac, and Linux.Built-in PDF editing and seamless cloud collaboration features.Free to download and easy to deploy for individuals and teams.
QA img-9

Frequently Asked Questions

Why does ListItemAllFields return current metadata instead of historical?

In the SharePoint REST API, expanding ListItemAllFields from a file version object defaults to the current list item state rather than providing a snapshot of the fields at that specific historical version.

How can I access historical metadata for a SharePoint document?

You must query the 'versions' endpoint of the specific list item (e.g., /items(id)/versions) rather than relying on the file version's expanded properties to see past metadata changes.

Does the SharePoint REST API support expanding FieldValuesAsText for past versions?

No, similar to ListItemAllFields, expanding FieldValuesAsText on a past file version typically yields the current text values. You need to pull the specific list item version directly.