#PowerPlatformTip 154: 'Preserve Author, Editor & Dates on Copied SharePoint Files'
TL;DR: After a create-and-delete copy, one
ValidateUpdateListItemHTTP request withbNewDocumentUpdate: truerestores the originalAuthor,Editor,CreatedandModifiedso the migrated file matches the source.
Sometimes a straight Copy file isn’t possible and you have to recreate a document with Create file + Delete file. The problem: the new file gets you as author, today as the created date, and loses the original history. With a single REST call to ValidateUpdateListItem you can write the original Author, Editor, Created and Modified values back onto the new item, so the migrated file is indistinguishable from the source.
💡 Challenge
You migrate or rebuild files across libraries where Copy file won’t work (different site, content type change, etc.), so you use Create file + Delete file. The recreated item now shows the flow’s identity as Created By / Modified By and the current timestamp as Created / Modified. Audit trails, “sort by newest” and compliance views are all broken.
✅ Solution
Author, Editor, Created and Modified are system fields. A normal MERGE or PATCH on AuthorId, EditorId, Created and Modified answers 204 No Content, but SharePoint keeps the current values. What works is the item method ValidateUpdateListItem: it takes the values the way a user would enter them in the form, and with bNewDocumentUpdate: true it writes them into the current version without creating a new one.
🔧 How It’s Done
1. Capture the original metadata before deleting the source.
🔸 From Get files (properties) / Get item keep: Author (Claims/Email), Editor, Created, Modified.
2. Prepare the values the way the form expects them.
🔸 People as a claims key, no user ID lookup needed:
1
[{'Key':'i:0#.f|membership|jane.doe@contoso.com'}]
🔸 Dates as text in the site’s regional format and time zone, not ISO 8601. An ISO value like 2022-03-14T08:15:00Z is rejected with “You must specify a valid date within the range of 1/1/1900 and 12/31/8900.” For a site with English (United States) format and the time zone (UTC+01:00) Amsterdam, Berlin, Bern…:
1
convertFromUtc(<Created>, 'W. Europe Standard Time', 'M/d/yyyy h:mm tt')
🔸 You find the site’s locale and time zone under Site settings > Regional settings or via _api/web/RegionalSettings?$expand=TimeZone.
3. Add the ValidateUpdateListItem request on the new item.
🔸 Send an HTTP request to SharePoint, named Restore_metadata, Method POST, Uri:
1
_api/web/lists/getbytitle('Documents')/items(ID)/ValidateUpdateListItem
🔸 Headers:
1
2
Accept: application/json;odata=nometadata
Content-Type: application/json;odata=nometadata
🔸 Body:
1
2
3
4
5
6
7
8
9
{
"formValues": [
{ "FieldName": "Author", "FieldValue": "[{'Key':'i:0#.f|membership|jane.doe@contoso.com'}]" },
{ "FieldName": "Editor", "FieldValue": "[{'Key':'i:0#.f|membership|john.smith@contoso.com'}]" },
{ "FieldName": "Created", "FieldValue": "3/14/2022 9:15 AM" },
{ "FieldName": "Modified", "FieldValue": "6/1/2022 12:42 PM" }
],
"bNewDocumentUpdate": true
}
4. Check the response. The call returns 200 OK even if a single field fails. Every field comes back with HasException and ErrorMessage.
🔸 Add Filter array on body('Restore_metadata')?['value'] and switch to advanced mode: @equals(item()?['HasException'], true). If the result isn’t empty, a value was rejected; ErrorMessage tells you why.
🔸 Verify in the library’s Created / Modified / Created By / Modified By columns.
5. Run this call last. Any later write to the item resets Modified/Editor to now.
🎉 Result
The recreated file shows the original Created By, Modified By, Created and Modified, exactly like the source. Audit trails stay intact, chronological sorting is correct, and compliance views remain trustworthy, even though the file was rebuilt via create-and-delete.
🌟 Key Advantages
🔸 Faithful migration: original author, editor and timestamps are preserved.
🔸 Standard action only: Send an HTTP request to SharePoint, no premium connector.
🔸 Selective by design: ValidateUpdateListItem writes only the fields you list in formValues.
🔸 No extra version: with bNewDocumentUpdate: true the version history stays as it is.
🛠️ FAQ
1. Why not a MERGE on AuthorId and Created?
Author, Editor, Created and Modified are read-only system fields. A MERGE or PATCH on them returns 204 No Content, but the values stay on the flow’s identity and today. ValidateUpdateListItem takes them as form values and accepts them.
2. What date format do Created and Modified expect?
The site’s regional format and time zone, as a user would type it, for example 3/14/2022 9:15 AM on an English (United States) site. Convert your UTC source values with convertFromUtc() and its format parameter. ISO 8601 strings are rejected.
3. What does bNewDocumentUpdate change?
With true the values are written into the current version. With false they are set as well, but SharePoint adds a new version to the history.
4. My Modified date keeps resetting to today, why?
Any subsequent update to the item overwrites Modified and Editor. Make this call the last write to the item so your values stick.
5. Does this need special permissions?
The connection must have permission to write to the library. Setting Author/Editor requires the account to be able to update those fields (site member/owner-level access).
🔗 Related Tips
- #PowerPlatformTip 153: Rename a SharePoint File with Power Automate, the companion rename trick using
FileLeafRef. - #PowerPlatformTip 133: SharePoint Updates with Power Automate, updating only the fields you need.
- #PowerPlatformTip 47: Batch-Method within SharePoint, bulk REST operations for large migrations.
This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy, which runs free live workshops (in German). See the next free workshop dates (in German). For companies that want this implemented for them, see KMUpower: Power Platform consulting & automation for SMEs (DACH).
