SharePoint Online – Last Modified
Issue: By default, SharePoint Online document libraries don’t float up the ‘Last Modified’ time when you make changes within a folder hierarchy. This will bring hate mail from your users, especially if they’ve moved from Box.com, where it works this way for any changes deep in the structure. Many old online articles try to cover this, but the solution has been evasive until I spent the better half of a day trying to figure it out in PowerApp while on my honeymoon in Hawaii. *flips Cray hat backward*
Solution: Screenshots of the PowerApp are below. I’ll work to write out the steps soon and go into depth. The one major limitation of this solution is that if you put an empty folder within a folder structure, it doesn’t trigger the update but instead shows a failed run, which isn’t actually a problem. Only files within folders will successfully start and run the job. That applies to folder -> folder -> folder -> folder -> folder -> file or as deep as you need to go, and it works very quickly, usually within a minute.
-
- Create a new automated app named ‘FolderModified.‘

2. ‘CFileName‘
{
"inputs": "@{triggerOutputs()?['body/{FilenameWithExtension}']}[email protected]{equals(triggerOutputs()?['body/IsFolder'],false)}",
"metadata": {
"operationMetadataId": "c697bc2a-8bcd-44ad-80bf-87f29e9b4455"
}
3. ‘CFolderPath‘
{
"inputs": "@triggerOutputs()?['body/{Path}']",
"metadata": {
"operationMetadataId": "ebace1b1-1fa1-4f76-8e97-4344ffe8c11b"
}
}

{
"inputs": {
"variables": [
{
"name": "VArrFolderPath",
"type": "array",
"value": "@split(outputs('CFolderPath'),'/')"
}
]
},
"metadata": {
"operationMetadataId": "c4aa6183-5a4c-4451-b045-97a8c020a83f"
}
}

{
"inputs": {
"variables": [
{
"name": "VPath",
"type": "string"
}
]
},
"metadata": {
"operationMetadataId": "9f50d26d-5624-4ef0-b02a-b98a41957d54"
}
}

{
"inputs": [
{
"Key": "@{triggerOutputs()?['body/Editor/Claims']}"
}
],
"metadata": {
"operationMetadataId": "e80df3fb-feec-4ea5-a683-ad7a5d9b5c65"
}
}

{
"inputs": "@formatDateTime(triggerOutputs()?['body/Modified'],'g')",
"metadata": {
"operationMetadataId": "beb03772-baf0-4615-bc04-7fd5650f46f9"
}
}

{
"inputs": [
{
"FieldName": "Editor",
"FieldValue": "@{string(outputs('CUser'))}"
}
],
"metadata": {
"operationMetadataId": "178a3d12-1338-456d-ab40-c9d1f4214bea"
}
}
'

{
"inputs": {
"from": "@variables('VArrFolderPath')",
"where": "@equals(empty(item()), false)"
},
"metadata": {
"operationMetadataId": "4a001a83-8073-4ff1-9e81-5e3a7073b027"
}
}





{
"inputs": {
"host": {
"connectionName": "shared_sharepointonline_1",
"operationId": "HttpRequest",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline"
},
"parameters": {
"dataset": "https://yoursite.sharepoint.com/sites/SITE",
"parameters/method": "POST",
"parameters/uri": "_api/web/lists/getbytitle('Documents')/items(@{outputs('IGFPath')?['body/ItemId']})/validateUpdateListItem",
"parameters/body": "{\n\"formValues\": @{outputs('CProperties')},\n\"bNewDocumentUpdate\": false\n}"
},
"authentication": "@parameters('$authentication')"
},
"metadata": {
"operationMetadataId": "5c59f1f4-cd00-4bd9-aa59-bde4deaa317d"
}
}
getbytitle('Documents') refers to the name of the Document Library. '/Shared Documents/ (Default) = Documents', or your 'Custom Name' for it.
***
- Top Folder:

- Objects within or within the sub-folders shown in the Last Modified above:

- Short runtimes:
