cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SolarWill
Helper I
Helper I

Including Sub-Folders in a Flow Query (Advanced)

Hello.

 

One very large disappointment from Microsoft is the fact that they don't support Alert Flows for sub-folders, only for the folder selected, or the top level/parent.

 

I was wondering if there was a way to code this into the JSON file then import into Flow.

 

Check out the default code:

 

            },
            "method": "get",
            "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://yoursitehere.com/folderiwanttobealertedfor'))}/triggers/onupdatedfile",
            "queries": {
              "folderId": "%252fALL%2bFILES%252fPARENTFOLDER",
              "includeFileContent": true,
              "queryParametersSingleEncoded": true,
              "inferContentType": true,
              "includeSubFolders": true
            },

Notice the last line

 

"includeSubFolders": true

I added that, and obviously it does not work. Microsoft - it is literally this easy, why? Because this does not work - I need to make over 300+ flows JUST to support alerts for all sub-folders under a parent.

 

Anyways - does anyone know if I can add/change a trigger

 

/triggers/onupdatedfile

 To maybe

 

/triggers/onupdatedhierarchy

Or - can I modify this query?

 

"folderId": "%252fALL%2bFILES%252fPARENTFOLDER", "code to include folders underneath"

This is the best way I can exlain myself - I apologize if it appears like a rant, but I've got 300+ flows I need to make to be alerted just under one parent folder because Microsoft doesn't support this.

1 ACCEPTED SOLUTION

Accepted Solutions

Is this the trigger that you are after:

 

WhenFile.PNG

Just leave the folder blank and all files/folders will trigger your flow.

 

By the way editing the json of a flow is not recommended. If you want to do this then please look at Azure Logic Apps instead.

View solution in original post

3 REPLIES 3

Is this the trigger that you are after:

 

WhenFile.PNG

Just leave the folder blank and all files/folders will trigger your flow.

 

By the way editing the json of a flow is not recommended. If you want to do this then please look at Azure Logic Apps instead.

Pieter, interesting reply.

 

This could be a solution - but I need alerts for when a file is created/modified in a parent folder and folders underneath.

 

I noticed that picture is of a "Properties Only" template - what does that mean?

 

I don't want to be notified of what changes in an entire document library, just one parent folder in that library and everything underneath that folder.

 

Thanks for the reply.

You should be able to leave the folder configuration blank and start the flow with a sindition in which you check the folder name in the Url. It does mean that the flows will run on every document chnage, however you could put your alerting local inside a condition.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,684)