
Announcements
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
}
]
}
}
}
What I've tried:
I have had no success with the above. Can anyone suggest what might be the issue?
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?