If you’ve ever built a Power Apps canvas app that connects to a SharePoint document library, you’ve probably hit this question at some point — how do I create a folder in SharePoint directly from my app?
It’s a really common requirement. Think about it: you’re building an app where users submit a project, and you want a folder automatically created in SharePoint to store all the related files. Or maybe you want users to type a folder name in a text box and click a button to create it on the spot. Super practical stuff.
The good news? There are three solid ways to do this. I’ll walk you through each one, with step-by-step instructions and real examples, so you can pick the approach that fits your use case best.
What You’ll Need Before Starting
Before we jump in, make sure you have:
- A Power Apps canvas app (or create a new one from scratch)
- A SharePoint document library (not a SharePoint list — folders live in document libraries)
- Appropriate permissions on the SharePoint site (at least Contribute)
- A Power Automate license
For this example, I have a SharePoint Document library called PDF Reports:

Create a Folder in SharePoint From Power Apps
Learn how to create folders in SharePoint directly from Power Apps using two simple and effective methods based on your use case and complexity.
Method 1: Trigger a Power Automate Flow from a Button (Recommended for Most Cases) in Power Apps
This is the most popular method, and honestly, the most flexible one. The idea is simple — you build a Power Automate flow that creates the folder in SharePoint, and then call that flow from a button in your Power Apps app. You can pass the folder name (and even a subfolder path) as input from the app.
This approach gives you more control, especially when you need to:
- Create nested folders or folder structures
- Check if a folder already exists before creating it
- Handle errors gracefully
- Return the folder path back to your app after creation
Step 1: Create the Power Automate Flow
- Go to flow.microsoft.com and click + New flow > Instant cloud flow
- Name your flow (e.g., “CreateSharePointFolder”)
- Select Power Apps (V2) as the trigger and click Create
Step 2: Add an Input Parameter
In the Power Apps (V2) trigger:
- Click Add an input
- Choose Text
- Name it
FolderName

This is how your Power Apps app will pass the folder name to the flow.
Step 3: Add the “Create New Folder” Action
- Click + New step
- Search for SharePoint
- Select Create new folder
- Fill in the fields:
- Site Address: Select your SharePoint site
- List or Library: Select your document library (e.g., Documents)
- Folder Path: Click the Dynamic content panel and select
FolderName(the input from Power Apps)

Step 4: Add a “Respond to a PowerApp or flow” Action (Optional but Useful)
If you want to confirm the folder was created or return the folder path back to Power Apps:
- Add a Respond to a PowerApp or flow action at the end
- Add an output — for example, a text field called
FolderPath - Set its value to the Folder Path output from the Create new folder action (available in dynamic content)

Click Save, and you’re done with the flow.
Step 5: Call the Flow from Power Apps
Back in your canvas app:
- Insert a Text input (
txtFolderName) and a Button

- Click the three dots (…) -> Power Automate in the toolbar
- Select your newly created flow from the list

- In the button’s OnSelect property, the formula will look like:
CreateSharePointFolder.Run(txtFolderName.Text)
If you set up the response action and want to capture the returned folder path:
Set(
varFolderPath,
CreateSharePointFolder.Run(txtFolderName.Text).folderpath
)

Step 6: Test It
Run the app, type a folder name, click the button, and check SharePoint. Done.

Want to create a subfolder? In the Folder Path field of the flow, just combine the parent folder and the input name:
/Documents/ParentFolder/FolderName
Or dynamically in the flow, use an expression like:
concat('/Shared Documents/', triggerBody()['text'])
When to use this method: For most real-world apps. It’s reliable, gives you error handling options, and works great for dynamic folder names, subfolders, and confirmation responses.
Method 2: Create a Folder Using REST API via Power Automate (Advanced & Flexible)
This is the method I use when I need full control over folder creation.
Instead of relying on the standard SharePoint action, you directly call the Microsoft Graph API using Microsoft Power Automate.
This approach is perfect when you need more than just basic folder creation.
You can:
- Create folders anywhere (SharePoint, Teams, OneDrive)
- Control what happens if the folder already exists (rename, replace, fail)
- Build dynamic folder paths
- Handle complex scenarios cleanly
This approach is less common but works when you want everything to happen within Power Apps, with no external flow dependencies.
Step 1: Create the Power Automate Flow
- Go to flow.microsoft.com
- Click + Create → Instant cloud flow
- Name your flow (e.g., CreateFolderRestAPI)
- Select Power Apps (V2) as the trigger. Click Create
Step 2: Add Input Parameters
- In the Power Apps (V2) trigger:
- Click Add an input
- Choose Text
- Name it: FolderName

Step 3: Add “Send an HTTP request to SharePoint”
Click + New step and Search: Send an HTTP request to SharePoint
- Site Address: Select your SharePoint site
- Method: POST
- URI:
_api/web/folders - Headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
- Body:
{
"__metadata": {
"type": "SP.Folder"
},
"ServerRelativeUrl": "/sites/dms-quality-compliance/PDFReports/@{triggerBody()?['text']}"
}
Make sure you replace the placeholders with your actual values:
- PDFReports → your document library name
- dms-quality-compliance → your SharePoint site name

Step 4: Call the Flow from Power Apps
Back in your canvas app:
- Insert a Text input (
txtFolderName) and a Button

- Click the three dots (…) -> Power Automate in the toolbar
- Select your newly created flow from the list

- In the button’s OnSelect property, the formula will look like:
CreateFolderRestAPI.Run(txtFolderName.Text)
Step 6: Test It
Run the app, type a folder name, click the button, and check SharePoint. Done.

Important: This method uses the SharePoint REST API through Microsoft Power Automate, so the account running the flow must have proper permissions on the Microsoft SharePoint site and document library. Even if your setup is correct, you may see errors like Access Denied if the connection used in the flow does not have access. Also, make sure the ServerRelativeUrl starts with the correct site path (for example, /sites/dms-quality-compliance/…) and uses the exact library name like PDFReports.
When to use this method: Use this method when you need more flexibility than the standard SharePoint action, such as creating folders with dynamic paths or handling custom scenarios. It’s a good middle-ground option when you want more control, but still want to stay within SharePoint without using the Microsoft Graph API.
How to Create a Folder Structure (Multiple Nested Folders)
Sometimes you don’t just need one folder — you need a whole structure. For example, when a new project is submitted, you want to auto-create:
/Projects
/ProjectName
/Documents
/Images
/Reports
The cleanest way to do this is with Method 2 (Power Automate flow), and you just add multiple “Create new folder” actions — one for each folder in your structure.
In Power Automate:
- First action: Create folder /Projects/ProjectName
- Second action: Create folder /Projects/ProjectName/Documents
- Third action: Create folder /Projects/ProjectName/Images
- Fourth action: Create folder /Projects/ProjectName/Reports
Just make sure each step runs only after the previous one completes (Power Automate does this sequentially by default in a standard flow).
If the folder names are coming from form fields in your app, pass each one as a separate input parameter in the Power Apps (V2) trigger.
Check If a SharePoint Folder Already Exists Before Creating It Using Power Automate
This is something people forget about, and it causes errors when users try to create a folder that’s already there.
In Power Automate, here’s the pattern I use:
- Add a Get files (properties only) action and filter by folder path
- Add a Condition action: check if the output is empty (no results = folder doesn’t exist)
- If true → run the Create new folder action
- If false → skip creation or show a message
You can send a message back to Power Apps using the Respond to a PowerApp or flow action — something like “FolderAlreadyExists” — and then display a notification in the app using Notify(“That folder already exists!”, NotificationType.Warning).
Quick Comparison of All Three Methods
| Method | Requires Flow | Difficulty | Best For |
|---|---|---|---|
| Patch with IsFolder | No | Easy | Simple root-level folder creation |
| Power Automate Flow | Yes | Medium | Dynamic names, subfolders, error handling |
| Graph API via HttpRequest | No | Advanced | Full API control, no flow overhead |
Common Errors and Fixes
- “Folder already exists” error in the flow: Use the check-before-create pattern described above, or set the conflict behavior to
renamein the API call - Blank folder name creates an error: Add a simple
If(IsBlank(txtFolderName.Text), Notify("Please enter a folder name"), ...)before running the flow - Flow not showing up in Power Apps: Make sure the flow is saved and turned on. Also confirm that the trigger is Power Apps (V2), not a different trigger type
- Patch method not working: Double-check that you’re connecting to a document library, not a SharePoint list. Lists handle folders differently
Conclusion
My personal recommendation for most scenarios is Method 1 — the Power Automate flow approach. It’s the most reliable, it handles errors well, and it’s easy to extend later (like adding subfolders or sending an email notification when the folder is created).
And if you’re comfortable with APIs and want maximum control, Method 2 via Rest API is worth exploring.
Whichever method you pick, the pattern is the same: collect the folder name from the user in the app, pass it to your creation logic, and handle the response gracefully.
Also, you may like:
- Parse JSON in Power Apps [10 Practical Examples]
- Dataverse Formula Column
- Migrate SharePoint Online List to Dataverse
- Build and Deploy a Smart HR Assistant Bot Using Copilot Studio
- Power Apps CountRows Function [Including the Delegation Fix]
- Power Apps Dropdown Show Only Unique Values
- Power Apps First Function

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.