# Create a document folder automatically for each new list item

> For the full documentation index, see https://250highstreet.com/llms.txt

> Power Automate can create a folder named from the item ID for each new SharePoint list item, then write the folder link back to the item. Steps and pitfalls.

Use the SharePoint action Create new folder after the trigger When an item is created, and put the item ID in Folder Path. Then use Update item to write the folder link back to the list item.

That is four actions in all. People click the link on the item and land in the right folder. Nobody has to create folders by hand or hunt for them.

## Why this helps

A SharePoint list holds the facts about a job, a client or a case. The files for it, such as contracts, photos and emails, live in a document library. Without a link between the two, people search the library by name and guess. Files end up in the wrong place, or in two places.

One folder per item, named from the item ID, fixes this. Our advice, not a Microsoft rule: use the ID. It is a plain number, and people do not edit it. A name like "Acme invoice (final)" can clash with another or break later. A number cannot.

A Microsoft Q&A answer to this exact question suggests the same shape: trigger on a new item, create the folder, get the folder details, then update the item with the folder address. The answer gives no detailed settings, so the steps below fill in what the connector pages list.

## What you need first

- A SharePoint list. Use the Title column for the item name. If Title is required in your list, rename it or turn off Require if it does not fit.
- A document library on the same site, or another site you can reach, where the folders will go.
- A column of type Hyperlink in the list, for example "Folder link". Add it with Add column in the list. Exact names may differ.
- A Power Automate license that allows the SharePoint connector. Check with your admin.

## Step 1. Start the flow with the new-item trigger

1.  Open Power Automate and choose to create an automated cloud flow.
2.  Pick the SharePoint trigger "When an item is created".
3.  Fill in the Site Address and the List Name. The connector page lists these two as required.

The flow now runs once for each new item.

## Step 2. Create the folder

1.  Add the action "Create new folder".
2.  Set Site Address to the site that holds your library.
3.  Set List or Library to your document library.
4.  In Folder Path, put the item ID from the trigger. Pick ID from the dynamic content list. The connector page shows a path example of folder1/folder2/folder3, so the folder name goes in that field.

Our advice, not a Microsoft rule: use the ID alone, or the ID plus a short fixed word, such as "Case-" before the ID. Avoid the Title in the folder name. Titles can hold slashes, quotes and other characters that SharePoint may not accept in folder names, and people edit Titles later.

## Step 3. Get the folder details

1.  Add the action "Get folder metadata using path". The connector page says it gets information about a folder using a folder path. A second action, "Get folder metadata", picks a folder by its file identifier.
2.  Set Site Address, then use the same folder path you used in Step 2.

The Microsoft Q&A answer says to use Get folder metadata to fetch the folder's URL. If you do not see a full web address in its output, build it from the site address and the folder path.

## Step 4. Write the link back to the item

1.  Add the action "Update item".
2.  Set Site Address and List Name to your list.
3.  Set Id to the item ID from the trigger. The connector page lists Id as required.
4.  If Title is required, set Title to the Title from the trigger, or the action fails.
5.  In the item fields, fill your Hyperlink column with the address of the folder.

Update item fills the Hyperlink column with one value, the address, and shows that address as the text. Setting separate display text, such as "Open folder", needs a Send an HTTP request to SharePoint action. Our advice, not a Microsoft rule: keep the plain address unless the long text bothers people.

## Subfolders and permissions

Microsoft's connector page describes Create new folder as creating "a new folder or folder path", and gives folder1/folder2/folder3 as the Folder Path example. So one Create new folder action can make a folder with subfolders inside it, for example 1042/Contracts.

The same page lists a separate action, Grant access to an item or a folder, described as granting access "to specific people". Add it after the folder is created if the folder needs its own people. Microsoft's pages do not show Create new folder setting permissions by itself.

## If the folder already exists

Microsoft's connector page does not say what Create new folder does when the folder is already there. Our advice, not a Microsoft rule: before you rely on the flow, add a second test item that reuses an ID, or re-run a finished run, and read the run history to see what happens in your library.

## A caution about loops

This flow changes the same item it started from. If you used the trigger "When an item is created or modified" instead, the update would fire the flow again, and again. Use "When an item is created" for this job. The connector page lists it as a separate trigger. If you must use the modified trigger, add a Condition that stops the flow when the Folder link column is already filled in.

## Step 5. Test with one item

1.  Save the flow.
2.  Add a test item to your list.
3.  Open the flow run history. Each step should show success.
4.  Open the library. Is there a folder named with the item ID?
5.  Open the item. Does the Folder link open that folder?

Fix the link first if it fails. Check the address built in Step 3 and Step 4 first.

## Items that already exist

The flow only acts on new items. Old items get no folder. One way to start: make a second, manual flow that reads your existing items with Get items, then adds an Apply to each loop that runs the same actions on each item. If you read items with Get items, the default returns only 100 rows, so set Top Count and Pagination. See "[Power Automate Get items stops at 100 rows: how to get them all](/guides/power-automate-get-items-only-returns-100/)".

## Who can open the folder

A link is not a lock. Anyone who can see the list item may click the link, but the folder opens only for people who have rights to the library. Hiding a column or a view does not protect files. Set permissions on the library itself. If the files are sensitive, ask your admin before you build this.

## What to avoid

- Do not name folders from free text such as the Title.
- Do not use the "created or modified" trigger for this flow, because the update can start the flow again.
- Do not skip the test. Run one item before you tell the team.
- Do not put the folder link only in the flow. Put it on the item, where people look.
- Do not move or rename folders by hand later. The saved links will break.
- Do not assume old items are covered.

## Related guides

For other flows and list setups, see "[Power Automate Get items stops at 100 rows: how to get them all](/guides/power-automate-get-items-only-returns-100/)", "[Replace a spreadsheet tracker with a SharePoint list](/guides/replace-spreadsheet-with-sharepoint-list/)" and "[Where SharePoint list attachments are stored, and when to use a library](/guides/where-do-sharepoint-list-attachments-go/)".

## When to get help

You can build all of this yourself in Microsoft 365. If you would rather have it built and tested for your team, I do that. A tracker like this is a fixed price: \$5,000 for one, built in 2 weeks. See "[What a SharePoint tracker costs to build](/guides/what-a-sharepoint-tracker-costs/)". Bring one example of the problem to a free call.

I am Al Davies. I run 250 High Street LLC and build SharePoint trackers and Power Automate flows for operations teams. I work remotely. The first call is free, and I will not try to sell you anything.

See trackers I built: [Tools I built](/portfolio/)

## FAQ

### Can the flow add subfolders too?

Yes. Microsoft describes Create new folder as creating a new folder or folder path, with folder1/folder2/folder3 as the Folder Path example.

### Why use the item ID and not the Title?

Our advice, not a Microsoft rule: the ID is a plain number that people do not edit. Titles can repeat, can hold characters that break folder names, and people change them.

### How do I set who can open the new folder?

Add the action Grant access to an item or a folder after Create new folder. Microsoft describes it as granting access to specific people.

### How do I create folders for items I already have?

The trigger fires only for new items. Run a separate flow that reads the old items with Get items and loops over them.

### Does the folder protect the files?

No. A folder and a link are for finding files. Protect files with permissions on the library.

### Can the flow make the folder inside the list instead of a library?

The action asks for a list or library. Our advice, not a Microsoft rule: use a document library for files.

### The folder was made but the link is empty. What now?

Open the run history and check the Update item step. Look at the value it sent to the Hyperlink column. If the folder details hold no full web address, build it from the site address and the folder path.

## Sources

- [Microsoft Q&A, What is the best way to create a folder in SharePoint, with a hyperlink to SharePoint lists](https://learn.microsoft.com/en-us/answers/questions/5379789/what-is-the-best-way-to-create-a-folder-in-sharepo)
- [Microsoft Learn, SharePoint connector reference](https://learn.microsoft.com/en-us/connectors/sharepointonline/)

## Related guides

- [Create a SharePoint list item from an email](/guides/power-automate-create-list-item-from-email/)
- [Create a Planner task automatically from a Forms response](/guides/power-automate-create-planner-task-from-form/)
- [Power Automate: write Approved or Rejected back to your SharePoint list](/guides/power-automate-update-sharepoint-status-after-approval/)
- [Replace the deprecated "When a file is created in a folder" trigger](/guides/power-automate-when-a-file-is-created-in-a-folder-deprecated/)

Source: https://250highstreet.com/guides/power-automate-create-folder-for-each-list-item/
