The problem
SharePoint Online folders don’t update their Modified date when something changes deeper inside them. A folder created two years ago still says “two years ago” even if someone edited a file three levels down this morning. Users coming from Box.com, where changes roll up, notice right away.
This walkthrough builds a Power Automate flow that fixes that. Whenever a file is added or changed, the flow walks up its folder path and touches every parent folder, so each one shows the latest Modified date and Modified By person. It usually finishes within a minute, at any folder depth.
What you’ll build, top to bottom:
- A SharePoint trigger that fires when a file changes in one library
- Four Compose steps and two variables that capture the file’s folder path and editor
- A Filter array that turns the path into a clean list of folder names
- A loop that rebuilds the path one folder at a time, looks up each folder’s ID, and stamps it with a SharePoint REST call

Before you start
You need:
- A Power Automate license that includes the standard SharePoint connector (most Microsoft 365 plans do)
- Edit rights on the target site and document library
- A service or automation account to own the flow, ideally one that won’t have its sign-in changed often (see Cautions at the end)
Write down three values for your library before you begin. You’ll type them into several steps.
| What | Example | Where it’s used |
|---|---|---|
| Site address | https://contoso.sharepoint.com/sites/Projects | Trigger, IGFPath, HTTP request |
| Library display name | Documents | Trigger (pick from list) and the HTTP request Uri |
| Library URL folder | Shared Documents | Not typed anywhere, but it’s the first folder in every path the flow sees |
The default library is shown as Documents but lives at /Shared Documents/. A custom library uses whatever name you gave it.
Naming convention used here: C = Compose, V = Variable or data step, I = loop or lookup. Name each step exactly as shown, because later expressions refer to steps by name. To rename a step in the new designer, click its title at the top of the side panel.
Part 1: Create the flow and set the trigger
- Go to make.powerautomate.com and choose Create → Automated cloud flow.
- Name it something like
FolderModified - Projects Documents. One flow covers one library, so put the site and library in the name. - In the trigger search, type
properties onlyand pick When a file is created or modified (properties only) (SharePoint). Click Create.- Don’t pick When an item is created or modified. That one is for lists and returns different fields.
- Click the trigger to open its panel and fill in:
- Site Address: pick your site from the dropdown, or choose Enter custom value and paste the URL.
- Library Name: pick your library (for example, Documents).
- Folder: leave blank so the whole library is watched.

The trigger checks for changes about once a minute. It hands every later step fields like Folder path, File name with extension, Modified and Modified By Claims.
Part 2: Capture the path and the editor
Add each step below the previous one with the + button → Add an action. To type an expression, click in the field, then the fx icon, paste the expression, and click Add. To insert a trigger field, use the lightning-bolt icon instead.
Step 2: CFileName (Compose)
Search Compose (Data Operation). Rename it CFileName. In Inputs, insert File name with extension, type a hyphen, then add this expression:
equals(triggerOutputs()?['body/IsFolder'],false)
This step is only for reading run history (for example, Report.docx-true). Nothing later depends on it, so it’s optional.

Step 3: CFolderPath (Compose)
Add another Compose, rename it CFolderPath, and insert the trigger field Folder path. Its expression is:
triggerOutputs()?['body/{Path}']
For a file in Projects › 2026 › Client A, this returns Shared Documents/Projects/2026/Client A/.

Step 4: VArrFolderPath (Initialize variable)
Search Initialize variable (Variables). Rename it VArrFolderPath.
- Name:
VArrFolderPath - Type: Array
- Value (expression):
split(outputs('CFolderPath'),'/')
This splits the path into a list: ["Shared Documents","Projects","2026","Client A",""]. Note the empty item at the end from the trailing slash.

Step 5: VPath (Initialize variable)
Add another Initialize variable, rename it VPath.
- Name:
VPath - Type: String
- Value: leave empty
The loop will build the path back up in this variable, one folder at a time. Variables must be initialized at the top level of a flow, never inside a loop or condition.

Step 6: CUser (Compose)
Add a Compose, rename it CUser. In Inputs, type the brackets and quotes by hand and insert the trigger field Modified By Claims between the quotes:
[
{
"Key": "<Modified By Claims>"
}
]
The claims value looks like i:0#.f|membership|jane@contoso.com. This is the person-field format SharePoint expects in the update call.

Step 7: CModified (Compose)
Add a Compose, rename it CModified, expression:
formatDateTime(triggerOutputs()?['body/Modified'],'g')
This is also for run history only; SharePoint stamps the folder with the current time on its own.

Step 8: CProperties (Compose)
Add a Compose, rename it CProperties. Type this, inserting the expression string(outputs('CUser')) where shown:
[
{
"FieldName": "Editor",
"FieldValue": "<string(outputs('CUser'))>"
}
]
Editor is the internal name of the Modified By column. This is the list of fields the HTTP request will write to each folder.

Step 9: VFilterFolderPath (Filter array)
Search Filter array (Data Operation). Rename it VFilterFolderPath.
- From: insert the variable VArrFolderPath
- Filter Query: left box = expression
empty(item()), operator is equal to, right box =false- Or click Edit in advanced mode and paste
@equals(empty(item()), false); both give the same result
- Or click Edit in advanced mode and paste
This drops the empty item, leaving ["Shared Documents","Projects","2026","Client A"].

Part 3: Walk up the folders and stamp each one
Step 10: IFolders (Apply to each)
Search Apply to each (Control). Rename it IFolders.
- Select an output from previous steps: insert Body from VFilterFolderPath
- Open the Settings tab, turn Concurrency control on, and set Degree of parallelism to 1
The concurrency setting matters. The loop appends to a variable on every pass; if passes run in parallel, the path is built out of order and the wrong folders get looked up.


The next three steps go inside the loop: use the + inside the IFolders box.
Step 10.1: Append to VPath (Append to string variable)
Search Append to string variable (Variables).
- Name:
VPath - Value: insert Current item from IFolders, then type a forward slash
/
The expression behind it is @{items('IFolders')}/. Over the passes, VPath grows like this:
| Pass | VPath |
|---|---|
| 1 | Shared Documents/ |
| 2 | Shared Documents/Projects/ |
| 3 | Shared Documents/Projects/2026/ |
| 4 | Shared Documents/Projects/2026/Client A/ |

The designer labels the loop’s current item as Body here; that’s expected.
Step 10.2: IGFPath (Get folder metadata using path)
Search Get folder metadata using path (SharePoint). Rename it IGFPath.
- Site Address: your site
- Folder Path: insert the variable VPath (don’t use the folder picker)
This returns the folder’s ItemId, its ID in the library, which the update call needs.

Step 10.3: CValid (Condition)
Search Condition (Control). Rename it CValid.
- Left box: insert ItemId from IGFPath
- Operator: is greater than
- Right box:
0
On pass 1, the path is the library itself, which has no item and returns ItemId 0. The condition skips it. Leave the False branch empty.

Step 10.3.1: Send an HTTP request to SharePoint (inside True)
Inside the True branch, search Send an HTTP request to SharePoint.
- Site Address: your site
- Method:
POST - Uri: type the text below, inserting ItemId from IGFPath between the parentheses
_api/web/lists/getbytitle('Documents')/items(<ItemId>)/validateUpdateListItem
Replace Documents with your library’s display name (the name you picked in the trigger, not the URL folder).
- Body: type the text below, inserting Outputs from CProperties after
"formValues":
{
"formValues": <Outputs of CProperties>,
"bNewDocumentUpdate": false
}
validateUpdateListItem writes the Modified By field. Because it’s a normal update, SharePoint also sets Modified to now, which is the point of the whole flow. bNewDocumentUpdate: false tells it this is an edit, not a new upload.

Part 4: Save, test and troubleshoot
- Click Save. The flow turns on as soon as it saves.
- In the library, create a test path such as Test › Level 1 › Level 2 and upload a file into Level 2.
- Within a minute or two, open My flows → your flow → Run history. You should see one run per changed file.
- Back in the library, Test and Level 1 should now show Modified: A few seconds ago and your name under Modified By.


| What you see | Why | Fix |
|---|---|---|
| Run fails right after you create an empty folder | Folders fire the trigger too, but an empty folder at the top has nothing above it to update | Expected; ignore. Only files inside folders run to the end |
| “This operation contains a token that does not exist” in the designer | The trigger’s fields hadn’t loaded when the step was added or pasted | Open the dynamic content picker once on any field, or remove and re-insert the token |
| “Invalid connection” on a SharePoint step | Step was copied or pasted from another flow | Open the step, click Change connection, and pick your SharePoint connection |
| HTTP request returns 404 or “List does not exist” | Wrong name in getbytitle('...') | Use the library’s display name, not Shared Documents |
| HTTP request returns 429 or runs back up | Too many files changed at once | Turn the flow off during bulk moves or migrations |
Folder path built wrong (e.g. 2026/Shared Documents/) | Loop running in parallel | Set IFolders concurrency to 1 |
Reusing it on other libraries, and cautions
Each library needs its own copy of the flow. The quickest way is My flows → … → Save As, then change these four places:
- Trigger: Site Address and Library Name
- IGFPath: Site Address
- HTTP request: Site Address
- HTTP request: the library name inside
getbytitle('...')
Cautions from running this on 35+ sites:
- Turn it off before migrations or bulk copies. Hundreds of changes at once cause 429 throttling errors and a backed-up run queue. A clogged flow sometimes has to be copied and the old one deleted to clear it.
- Don’t bulk-copy files as the flow’s own account. The flow sees its own updates as new changes and can keep touching folders long after the copy ends.
- Pick a stable owner account. Changing its sign-in, such as turning on MFA, breaks the connections and every flow has to be re-connected.
- Expect a few “failed” emails. They’re usually the empty-folder case above. Microsoft also turns off flows that don’t run for a long time and emails a warning first.
Have a better way to do this? Let me know in the comments.