web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : D5zL0mQn44p2V3f4bu0LVZ
Power Automate - Building Flows
Unanswered

How to differentiate between Folders and Files when using the Sharepoint triggers?

Like (0) ShareShare
ReportReport
Posted on 19 Jun 2018 10:44:17 by

The Sharepoint trigger "When a file is created or modified" is triggered for both Folders as well as Files

 

So, when ones creates a new file, the trigger is fired once for the File, and once for the Folder if it happen to be created during that call. However, there is no output field in the trigger that indicates that the event was triggered for a File or a Folder.

 

Is there a work-around to differentate both cases? The only thing I can think of is to classify files as having at least a "." in the FileName With Extension field, but extensions are not a mandatory thing on some OSs (at least, I think so)

I have the same question (0)
  • Lübbe Profile Picture
    27 on 25 Oct 2022 at 12:47:05
    Re: How to differentiate between Folders and Files when using the Sharepoint triggers?

    ... this is an old issue, so may be 2018 or 2020 the following field wasn't there ...

     

    Today I just use the field {IsFolder} in the triggerBody.

    And instead of testing this inside the flow, I added the regarding condition @not(triggerBody()?['{IsFolder}']) directly to the trigger, so the flow only starts, if the created or changed item is not a folder.

     

    Happy coding, Lübbe

     

    Lbbe_1-1666701953078.png

     

    Lbbe_0-1666701914580.png

     

  • Meena_Makwana Profile Picture
    on 20 Feb 2020 at 21:44:48
    Re: How to differentiate between Folders and Files when using the Sharepoint triggers?

    Hi Mabel, 

     

    The solution you suggested is working. Thanks for Sharing 🙂

     

    Regards,

    Meena Makwana

     

     

  • v-yamao-msft Profile Picture
    on 21 Jun 2018 at 07:26:07
    Re: How to differentiate between Folders and Files when using the Sharepoint triggers?

    Hi @goderis,

     

    According to your description, I crated a flow with the trigger “When a file is created or modified (properties only)”, I found that it will be also triggered when a folder is created or modified.

     

    If you want to differentiate between folders and files, you could use the dynamic content File name with extension from the trigger.

     

    To test this issue, I created a simple flow likes below. I configured the Condition as File name with extension contains ‘.’. Then when a folder is created, no notification will be sent.

     

    Please take the following screenshot for a reference.

    1.PNG

     

     

     

    Best regards,

    Mabel Mao

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 725 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 363 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 341

Last 30 days Overall leaderboard
Loading started