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.

View solution in original post

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,320)