2 Best Ways to Create a Folder in SharePoint From Power Apps

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:

How to create a folder in SharePoint Library from Powerapps

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

  1. Go to flow.microsoft.com and click + New flow > Instant cloud flow
  2. Name your flow (e.g., “CreateSharePointFolder”)
  3. 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
How To Trigger A Power Automate Flow From PowerApps

This is how your Power Apps app will pass the folder name to the flow.

Step 3: Add the “Create New Folder” Action

  1. Click + New step
  2. Search for SharePoint
  3. Select Create new folder
  4. 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)
Powerapps button trigger through power automate

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:

  1. Add a Respond to a PowerApp or flow action at the end
  2. Add an output — for example, a text field called FolderPath
  3. Set its value to the Folder Path output from the Create new folder action (available in dynamic content)
Call Power Automate flows from Power Apps components

Click Save, and you’re done with the flow.

Step 5: Call the Flow from Power Apps

Back in your canvas app:

  1. Insert a Text input (txtFolderName) and a Button
 Create a Folder in SharePoint library from Power Apps
  1. Click the three dots (…) -> Power Automate in the toolbar
  2. Select your newly created flow from the list
Trigger a Power Automate Flow from a Button to create folder in library using Power Apps
  1. 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
)
Power Automate Flow from a Button to create folder in library using Power Apps

Step 6: Test It

Run the app, type a folder name, click the button, and check SharePoint. Done.

Create a Folder in SharePoint from Power Apps uisng power Automate

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

  1. Go to flow.microsoft.com
  2. Click + Create → Instant cloud flow
  3. Name your flow (e.g., CreateFolderRestAPI)
  4. 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
How To Trigger A Power Automate Flow From PowerApps

Step 3: Add “Send an HTTP request to SharePoint”

Click + New step and Search: Send an HTTP request to SharePoint

  1. Site Address: Select your SharePoint site
  2. Method: POST
  3. URI: _api/web/folders
  4. Headers:
{
  "Accept": "application/json;odata=verbose",
  "Content-Type": "application/json;odata=verbose"
}
  1. 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
Power Apps Create Folder Using REST API via Power Automate

Step 4: Call the Flow from Power Apps

Back in your canvas app:

  1. Insert a Text input (txtFolderName) and a Button
 Create a Folder in SharePoint library from Power Apps
  1. Click the three dots (…) -> Power Automate in the toolbar
  2. Select your newly created flow from the list
 Create a Folder in SharePoint from Power Apps with Power Automate
  1. 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.

How to Create a Folder in SharePoint from Power Apps

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:

  1. First action: Create folder /Projects/ProjectName
  2. Second action: Create folder /Projects/ProjectName/Documents
  3. Third action: Create folder /Projects/ProjectName/Images
  4. 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:

  1. Add a Get files (properties only) action and filter by folder path
  2. Add a Condition action: check if the output is empty (no results = folder doesn’t exist)
  3. If true → run the Create new folder action
  4. 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

MethodRequires FlowDifficultyBest For
Patch with IsFolderNoEasySimple root-level folder creation
Power Automate FlowYesMediumDynamic names, subfolders, error handling
Graph API via HttpRequestNoAdvancedFull 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 rename in 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:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App