web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Can't update Modified ...
Power Automate
Unanswered

Can't update Modified field in SharePoint library via ValidateUpdateListItem

(0) ShareShare
ReportReport
Posted on by 101

In the past, I've been able to update the Modified and Modified By fields of files in a SharePoint library (note: library, not list) by making an HTTP request to ValidateUpdateListItem. It's described here - #FlowNinja hack 78 - modifying Modified By and Modified time with Microsoft Flow — John Liu .NET. Unfortunately, this now seems to have stopped working.

 

This is the body of the request.

 

{"formValues":[
{
 "FieldName":"Editor",
 "FieldValue":"[{'Key':'i:0#.f|membership|***email***'}]"
},
{
 "FieldName":"Title",
 "FieldValue":"000000000test.docx"
 },
 {
 "FieldName":"FileLeafRef",
 "FieldValue":"000000000test.docx" 
},
 {
 "FieldName":"Modified",
 "FieldValue":"2024-03-18 16:20:00Z"
 }
],
"bNewDocumentUpdate":true,
"datesInUTC":true
}

 

 

The file is renamed correctly but the actual modified time is the time the flow runs, and the user who modified it is set to myself.

 

Response:

 

{
 "d": {
 "ValidateUpdateListItem": {
 "__metadata": {
 "type": "Collection(SP.ListItemFormUpdateValue)"
 },
 "results": [
 {
 "ErrorCode": 0,
 "ErrorMessage": null,
 "FieldName": "Editor",
 "FieldValue": "[{'Key':'i:0#.f|membership|***email address***'}]",
 "HasException": false,
 "ItemId": 326
 },
 {
 "ErrorCode": 0,
 "ErrorMessage": null,
 "FieldName": "Title",
 "FieldValue": "000000000test.docx",
 "HasException": false,
 "ItemId": 326
 },
 {
 "ErrorCode": 0,
 "ErrorMessage": null,
 "FieldName": "FileLeafRef",
 "FieldValue": "000000000test.docx",
 "HasException": false,
 "ItemId": 326
 },
 {
 "ErrorCode": 0,
 "ErrorMessage": null,
 "FieldName": "Modified",
 "FieldValue": "2024-03-18 16:20:00Z",
 "HasException": false,
 "ItemId": 326
 }
 ]
 }
 }
}

 

 

msedge_0QqODiQal3.png

What I've tried:

  • Setting the Modified By field at the same time
  • Adjusting the Read Only attribute on Modified to false
  • Adjusting the Read Only attribute on Last Modified to false
  • Adjusting the Read Only attribute on Last Modified Date to false
  • Setting a different DateTime column with the same value, to check my formatting isn't at fault

I have had no success with the above. Can anyone suggest what might be the issue?

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Spinner,

     

    I will have a look if I can reproduce not being able to update the Modified value.

     

    In the meantime I see you have used a datesInUTC parameter in the validateUpdatelistItem method. I am unfamiliar with that specific parameter. Also the documentation only lists the formValues and bNewDocumentUpdate parameters, https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246412(v=office.15)#parameters

     

    My suggestion would be to try it without that datesInUTC parameter to see if that makes a difference?

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard