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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / problem with trigger: ...
Power Automate
Answered

problem with trigger: When file is created (properties only)

(0) ShareShare
ReportReport
Posted on by 366

Hello All,

I have noticed that when I use the trigger: When a file is created and specify the folder name if that folder has a subfolder the trigger will run when a file is created inside the subfolder as well.

 

how to make the trigger runs only when the file is created inside the main folder?

Regards

Categories:
I have the same question (0)
  • nitishsh91 Profile Picture
    200 on at

    Hi @SiyamandRashid 

     

    You can use the "Filter query" option in the "When a file is created" trigger to specify that the trigger should only run when a file is created inside a specific folder.

    Use the "When a file is created" trigger as usual.

    In the "Folder path" field, specify the main folder's path.

    In the "Filter query" field, add the following expression: startswith(folder/path, '<main folder path>')

    This expression will filter out any files that are not located in the main folder or its subfolders.

     

  • Siyamand Rashid Profile Picture
    366 on at

    Thank you very much for your reply,

    I don't see filter query field, please advise 

    SiyamandRashid_0-1674563160162.png

     

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hi @SiyamandRashid 

    I guess what @nitishsh91 referred to trigger conditions. You could a trigger condition like that:

    @equals(triggerOutputs()?['body/{path}'], 'Shared Documents/')

    This would only trigger the workflow if the folder name is "Shared Documents".

    Hope that helps!

    Ferran

  • Siyamand Rashid Profile Picture
    366 on at

    Thank you very much @fchopo  and @nitishsh91  the condition you wrote i have to write it in the folder field?

  • fchopo Profile Picture
    8,003 Moderator on at

    No, in the trigger conditions (see link I attached in my previous post).

  • Siyamand Rashid Profile Picture
    366 on at

    Thank you very much for the reply

    I didnt expect to be complicated like this initially when you select a folder it should not include the subfolders, Microsoft should look into this.

    any way thanks alot fir your support. 

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @SiyamandRashid 

    On the other side, there are people that asked it to be recursive (look inside subfolders). 😅

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard