Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
 View Only
  • 1.  How to exclude folders from the flow "when an item or file is modified"

    Posted Feb 17, 2023 01:36 PM

    I have a flow in which when a user uploads a document and sends it for approval, the Approvals flow is activated in which they notify another user to approve the document and subsequently change the approval status of this document.

    This flow runs inside a Library Name which contains different folders, let's call it this way to explain in detail.


    • Folder 1
    • Folder 2
    • Folder 3
    • Folder 4
    Currently I have the flow as follows:

    sebastianslz_0-1676653058635.pngWhat I would like to do is exclude the folder called "Folder 3" from this flow and that approvals are not required for the documents that are there.

    Reviewing the trigger options there is a section that allows me to add the folders that I want to be included in the flow Can I add the rest of the folders "Folder 1, Folder 2, Folder 4" ? Or is there some way to exclude the "Folder 3" folder from the flow.

    If I leave it blank it will take into account all the folders that are inside Library Name.

    I appreciate anyone who can help me with this flow.

    John Doe

  • 2.  RE: How to exclude folders from the flow "when an item or file is modified"

    Silver Contributor
    Posted 30 days ago

    Your best/easiest option would be to set these documents up in their own library. There's no need to squash everything into a single library and having separate libraries lets you have different settings or workflows without impacting everything.

    I have several concerns with your suggestion about listing individual folders - either as an inclusion or exclusion

    • What happens when a user adds a new folder? Will you be stuck having to sync the list of folders to your flow? 
    • What happens if a folder isn't listed in your flow? 
    • How will users know which folders the flow runs on or doesn't run on? 
    • What happens when a user puts a document in a folder with the expectation that the workflow will/will not run, but maybe it's in the wrong folder? 

    The easiest answer is to have separate libraries. Name it something obvious like "Documents for Approval". If they want it approved, put it there. If not, then don't.

    Otherwise, you'll need to work through the user issues cuz I guarantee they will NOT do what you think is obvious. 

    Rachel Davis
    Program Manager, Business Operations
    Rockwell Automation

  • 3.  RE: How to exclude folders from the flow "when an item or file is modified"

    Bronze Contributor
    Posted 27 days ago

    Rachel Davis's answer is a better approach than what I've done, which is much closer to OP is after. 

    In our approach, we have a document library into which all invoices requiring approval are placed, in folders by approver. Each approver folder has a sub-folder for approved invoices - so once they've approved them, invoices go into that subfolder. The approved invoice subfolders all have consistent naming convention (and users don't have permissions to muck about with the naming), so the flow has a condition that checks for whether the (sub)folder name contains a particular string, and if it is found, does not proceed. 

    So basically rather than using an OData filter to screen out folders or files you don't want, you can do some of that afterwards with a condition (or switch, but those are fussy because they are not good for partial string matches). Not as efficient as you might like, but it will do the job, and you may find it a useful way to handle some filtering eventually. Still better to rethink your approach like Rachel said though.

    Rob Clark
    Strategic Pricing Manager