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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / One Flow to Rule them ...
Power Automate
Unanswered

One Flow to Rule them All?

(1) ShareShare
ReportReport
Posted on by Microsoft Employee
I have Flows monitoring subsite document libraries. They all do the same thing. They send an alert whenever someone outside our domain add/changes a document in one of the document libraries.
 
I recently received a request from one of the stakeholders of the project to change part of the Flow. Before I go and change numerous flows, I want to make sure I'm handleing this the right way.
 
It is my understanding that I need to have a Flow for each site because of each library's unique file path. (Remember these are subsites.) From a visual point of view I currently have this;
 Screen Shot 2019-02-07 at 5.15.21 PM.png
Is it possible to have one Flow watch over all subsite document libraries like this?
Screen Shot 2019-02-07 at 5.28.34 PM.png
Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous,

     

    Thanks for the questions and good diagrams to explain your requirment.

     

    What I understood is you want to generalize a flow from a single trigger.

     

    You could try the following

    sharepointlists.png

     

    So your trigger going to be Recurrence.

    Define your site address.

     

    In the apply each you could add a check condition to check your library name matching "Displayname". I haven't added this if condition in my example. Then check Get Items to get each libraries.

     

    So the next challenge is how the user updated or created a document. So for this you need a custom column to add in your SharePoint document libraries called 'lastcheckedbyflow' with a datetime. Check this by modifed date from the meta data of "Get items". Then do your rest of the logic to send alert. Once the alert is send then you update the list column 'lastcheckedbyflow' by using the same value as modified date. So when next time a user updates the same document the 'lastcheckedbyflow' value is different so that you can send alerts.

     

    If it is useful then please accept this as solution.

     

    Let me know how it goes.

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I had some time to experiment with this today. I configured the Flow to send me an email with the results. When I went to run it on the parent site I only get the Document library in the parent site. In otherwords it does not appear to acknowledging that the subsites exist.

     

    I then changed the URL in the Get all lists and libraries step to a site where I have two document libraries. When I ran it again I received two emails; one for the Documents library, and a second one with the library I created. I'm extremely confident in saying the Get all lists and libraries only works for the site URL you provide and nothing underneath it.

     

    Just to be clear because I am rather new at this, this is what my flow looks like so far. Am I doing something wrong or different from what you suggested?

    Screen Shot 2019-02-12 at 3.15.03 PM.png

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous,

     

    Thanks for your reply. Sorry I didn't realised that you have different sites.

     

    So in this case you need to declare a compose function expression createArray('https://site1', 'https://site2','https://site3'). Next put this in a loop and dynamically read the site names. Again next action is another loop to get all document libraries under each sites and so on.

     

    If you need any help please let me know.

     

    If you found this answer is helpful please mark it as accepted solution.

     

    Thanks

     
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Forgot to add the image

    sites.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    No problem, I appreaciate the help. I try my best to explain what I have and what I am trying to do. I always manage to leave some important detail out. Smiley Wink

     

    So in my compose createArray, am I putting in the address of each of the subsites? I didn't get a chance to look at this yet, but I'm hoping there isn't a limit as to how long that string{statement} can be for createArray...

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous,

     

    Thanks for your reply. Not sure about the length. I tried upto 11 sites and it did worked.

     

    comp1.png

     

     

     

     

     

     

     

     

     

    Let me know how it goes. Good luck.

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is more of a bump than anything else. I wanted to let you know I'm still working on this.

     

    I was sidetracked the last few days by a project with a higher priority. Had some time today to play with things and making progress. Thank you for your help so far. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    To piggy-back on ABM's comment... Why not add multiple actions "Get all lists and libraries" and add an action for every site.

    So it would be like this... if referencing ABM's image...

    --Recurrence

    --Get all lists and libraries (Parent)

    --Get all lists and libraries (subsite 1)
    --Get all lists and libraries (subsite 2)

    --Get all lists and libraries (subsite 3)

    --etc. for each subsite. 

     

    Does this ideology expand upon your thought process in a way that is helpful?

  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Anonymous ,

     

    Thanks for the update. If you need anymore help let me know.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Okay, so this is where I am with things. I am able to get a list of libraries for a site. I now need to be able to iterate my way through each library to see what the Modified date is and compare that to the LastCheckedByFlow column I created in my library.

     

    I'm thinking my logic should be this;

    For each file in library
    
         If LastCheckedByFlow is null then
             LastCheckedByFlow = (Now)
         End if
         
         If Modified > LastCheckedByFlow
               If domain <> our domain
                   Send an email
               End if
         End if
    
     Set LastCheckedByFlow to (Now)

    I figure since on my very first pass, LastCheckedByFlow will be a null so I better set it ASAP so it doesn't  error out somewhere.

     

    I started working on the Flow but I'm stuck. Admittedly I don't know if I'm on the right track, but I'm trying to address the LastCheckedByFlow property. How do I do that? And how do I do that? With that bit of knowledge (and confirmation I'm on the right path) I'll keep on working. 🙂

     

    Screen Shot 2019-02-21 at 3.12.29 PM.pngScreen Shot 2019-02-21 at 3.12.58 PM.pngScreen Shot 2019-02-21 at 3.13.34 PM.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard