How to Extract SharePoint List Version History Timestamps with Power Automate
Question details
The user needs to retrieve and summarize timestamps from a SharePoint list's version history to measure the time spent in various work stages.

- Product
- Power Automate
- Device & OS
- not provided
- Scenario
- Automating the retrieval of version history data from a SharePoint list to calculate and track stage durations.
- Observed behavior
- To successfully query the versions endpoint, extract the 'Modified' timestamps for each version, format them correctly, and output the data into a summarized format like an HTML table.
Ensure you have Site Owner or Member permissions for the target SharePoint site and access to create flows in Power Automate. Have your SharePoint Site URL and List Name ready.
Retrieve and Format Version History via SharePoint REST API
Since Power Automate lacks a built-in action for list version history, you can use the 'Send an HTTP request to SharePoint' action to query the API and process the timestamps.
By directly calling the SharePoint REST API within Power Automate, you can access every iteration of a list item. You can then isolate the 'Modified' timestamp for each version to track how long an item remained in a specific status.
Create a new flow in Power Automate. Use a trigger such as 'When an item is created or modified' or 'For a selected item' to capture the ID of the SharePoint list item.
Add the 'Send an HTTP request to SharePoint' action. Set the Method to 'GET'. In the Uri field, enter: _api/web/lists/getbytitle('YourListName')/items(@{triggerOutputs()?['body/ID']})/versions (replace 'YourListName' with your actual list name).
Add a 'Select' action. Use the 'value' array from the HTTP request output as your 'From' parameter. Map your keys (like Status or Editor) and map the timestamp using the 'Modified' field.
In the 'Select' action's value mapping, use the formatDateTime expression to make the timestamps readable. For example: formatDateTime(item()?['Modified'], 'yyyy-MM-dd HH:mm').
Add the 'Create HTML table' action and use the output from the 'Select' action as its input. You can now email this table or save it to a document.

Boost Your Workflow Productivity with WPS Office
While Power Automate handles your SharePoint data extraction, choose WPS Office as your daily driver for managing exported reports, spreadsheets, and presentations. It offers high compatibility with Microsoft formats, a lightweight design, and is completely free to use.
- 1. Download and Install: Visit the official WPS Office website to download the free, lightweight office suite.
- 2. Open Exported SharePoint Data: Launch WPS Spreadsheet to easily open HTML tables or CSV files exported from your Power Automate flows.
- 3. Analyze and Save: Use familiar spreadsheet formulas to calculate time differences between work stages, then save seamlessly in .xlsx format.

Frequently Asked Questions
Can I extract SharePoint version history in Power Automate without using the REST API?
No, Power Automate currently does not have a native 'Get item version history' action. Utilizing the 'Send an HTTP request to SharePoint' action to query the REST API is the standard and most reliable method to achieve this.
How do I calculate the time difference between two version timestamps in my flow?
You can use the ticks() function in Power Automate. Convert both 'Modified' timestamps to ticks, subtract the older timestamp from the newer one using the sub() function, and then divide the result by 600,000,000 to convert the ticks into minutes.
Why is my formatDateTime expression resulting in an error?
This typically occurs if the input value is null or not formatted as a valid ISO 8601 string. Ensure that the JSON parsing from the HTTP request correctly identifies the 'Modified' field, and apply the expression accurately: formatDateTime(item()?['Modified'], 'yyyy-MM-dd').




