cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

Re: Including Sub-Folders in a Flow Query (Advanced)

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
Highlighted

Re: Including Sub-Folders in a Flow Query (Advanced)

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

Highlighted
Helper I
Helper I

Re: Including Sub-Folders in a Flow Query (Advanced)

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.

Highlighted

Re: Including Sub-Folders in a Flow Query (Advanced)

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 ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (4,749)