September 25, 2022

Automating file management is an excellent way to save a lot of time, especially if you have many of them. There are many advantages to knowing when a file is created, and for that, we have the SharePoint “When a file is created in a folder” trigger. 

To see the SharePoint “When a file is created in a folder” trigger in action, you can go to my cookbook section or check the template “Import a new Excel automatically to a list” that gets an Excel file and imports all its rows to a SharePoint List.

With that out of the way, let’s explore the SharePoint “when a file is created in a folder” trigger a bit more.

Where to find it?

To find it in the SharePoint section.

Select “when a file is created in a folder”. 

Here’s what it looks like:

Pro Tip:
Power Automate tends to save the most common triggers in the main screen, so check there before going trough the full hierarchy. Also you can use the search to quickly find it.


The SharePoint “when a file is created in a folder” trigger is quite simple. You only need to provide the site address and the folder that you want to search.

Although you can, please don’t generate the “Folder Id”. It’s always better to define beforehand where you’ll look for files.

Let’s look at the simplest case. Open the picker, and you’ll see the following:

The “Shared Documents” is the default “Document Library” created when the SharePoint Site is created. But as you can see, there are a lot more folders to choose from. In addition, you can pick other “Document Library”:

You can also pick the “Site Pages” to check if a new page is created for example. The“Site Assets” is used to store all the content and files necessary for a SharePoint site to function correctly, like Logos, OneNote notebook, to name a few, can also be used as the source of the trigger. But the most interesting, in my opinion, is the “Lists”. Since your list items can have attachments, you can monitor adding an attachment and parse that file.

Microsoft did a fantastic job hiding the complexity and allowing you to access all the areas with files in the same place.


The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

    "statusCode": 200,
    "headers": {
        "Pragma": "no-cache",
        "Transfer-Encoding": "chunked",
        "Retry-After": "0",
        "Vary": "Accept-Encoding",
        "x-ms-file-id": "%252fShared%2bDocuments%252fAttachment%252fExcel%2bTemplate.xlsx",
        "x-ms-file-name": "Excel Template.xlsx",
        "x-ms-file-path": "/Shared Documents/Attachment/Excel Template.xlsx",
        "x-ms-file-name-encoded": "<redacted>",
        "x-ms-file-path-encoded": <redacted>",
        "x-ms-file-etag": "\"<redacted>,1\"",
        "x-ms-request-id": "<redacted>",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Cache-Control": "no-store, no-cache",
        "Location": "<redacted>",
        "Set-Cookie": "<redacted>",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Date": "Mon, 20 Sep 2021 16:09:44 GMT",
        "Content-Disposition": "attachment",
        "Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "Expires": "-1",
        "Last-Modified": "Mon, 20 Sep 2021 16:09:44 GMT",
        "Content-Length": "17922"
    "body": {
        "$content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "$content": "<redacted>"

Please note that we get the file itself in the trigger. This makes it easier since you don’t need to do another action to fetch it. You also have the file Id so that you can change, move or do any other necessary actions.


The trigger does not fire if a file is added or updated in a subfolder of the folder that you defined. Also, this only applies to new files. If the file is changed this trigger won’t fire.


Here are some things to keep in mind.

Don’t generate the folder ID

I always recommend against generating the ID. Although it’s possible to get the ID by encoding the special characters, it’s pretty error-prone if you know the path. For example, if Microsoft changes something in Power Automate, you’ll get into trouble, but if you use the IDs from other actions, your Flows become future proof to any changes that may occur.

Name it correctly

The name is super important in this case since we can get the trigger from anywhere and with anything. Always build the word so that other people can understand what you are using without the need to open the action and checking the details.

Always add a comment.

Adding a comment will also help to avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and the data used. Also, define why you’re searching in the specified folder. The folder’s name may not be enough to explain what it is and why it’s being used. It’s crucial to enable faster debugging when something goes wrong.

Am I missing something? Leave a comment or interact on Twitter. Let’s work together to make this reference as complete as we can

Back to the Power Automate Trigger Reference.

Photo by Timon Studler on Unsplash

Manuel Gomes

I'm a previous Project Manager, and Developer now focused on delivering quality articles and projects here on the site. I've worked in the past for companies like Bayer, Sybase (now SAP), and Pestana Hotel Group and using that knowledge to help you automate your daily tasks

View all posts by Manuel Gomes →

10 thoughts on “Power Automate: SharePoint When a file is created in a folder Trigger

  1. Hi Manuel, good info about the trigger.
    Do you know of a simple way to trigger on file creation in any subfolder, without the need to specify names of subfolders?
    So if I monitor \documents that it triggers on file creation in \documents\1234, \documents\87126 etc.

    1. Hi Johannes,
      Yes, it’s possible but for the whole library. You can use the “When a file is created (properties only) trigger”.
      You can use it without a defined path, and it will trigger all files. So if you don’t have a dynamic library, it could be good to use it.
      To get only the subfolders, you can use the contains function with something g like “/folder_1/folder_2/” so that you know what you will catch everything under folder_2.
      Would this be possible?

      1. Thank you for your quick and helpful answer, Manuel!
        I don’t know the exact structure of the system I will need this for yet, but I feel confident to be able to solve the task with your information.

  2. Hi Manual, is there a way to get the link in an email notification when you have a new file added to a folder or library?

  3. Hi Manuel,
    Could you advise any workaround for limitation of this trigger you mentioned?
    I need a simple one to fire the flow when file is Added (Moved from other folder) to the sub-folder.

    I will appreciate any suggestion.

    1. HI KoYoT,
      Not that I’m aware of, but if I find something or someone else knows of one, I’ll post it here.
      Sorry 🙁

  4. I need to trigger the flow when an new file is created in site. Not for any specific list or library. Is it possible to do that?

    1. The broader that you can go is with the “When a File is created (properties only) trigger”. It checks for sub-folders, but it’s always limited to a document library.
      For a whole site is tricky, but if you don’t have a lot of document libraries, this could be a solution for you, but you would always have to duplicate it depending on the number of libraries you have.

Leave a Reply

Your email address will not be published.