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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Loop through all subsi...
Power Automate
Unanswered

Loop through all subsites in Site Collection

(0) ShareShare
ReportReport
Posted on by 37

How do I loop through all of the subsites within a site collection in SharePoint Online?  I have a site collection for project sites and each of those are created based on a template, so they all have the same lists and columns.  What I need to do is go through each of those subsites and do custom calculations on a column in a task list on a daily basis.  Also, based on those calculations, I need to send an email to the person responsible for those tasks as a reminder that they are coming due, are due, or are past due.  But, since the subsites will be created dynamically, I need to loop through them without necessarily knowing they exist, so I can't set it up for specific subsites by name.

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @MrAl 

     

    Try the following REST API

     

    _api/web/webs/?$select=title,ServerRelativeUrl

     

    image.png

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

    Hi @MrAl 

     

    If you need any further help please let me know. 

     

    If your problem has solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

     

    Thanks

  • MrAl Profile Picture
    37 on at

    Hi @abm 

    Thanks for you reply.  I wrote a simple "Sandbox" flow and tried to implement your suggestion.  So I have it set up as a scheduled flow, followed by the Send an HTTP Request with the RestAPI, then an email.  When I try to input the info from the Send HTTP Request into the email, all I have is "Body", and when I ran it, it sent something I could use, but how do I parse that information?  

     

    Here is part of what I see: 

     

    ":[{"__metadata":{"id":"https://site.sharepoint.com/sites/<basesite>/_api/Web","uri":"https://site.sharepoint.com/<basesite>/<subsite>/_api/Web","type":"SP.Web"},"ServerRelativeUrl":"/sites/<basesite>/<subsite>/Test","Title":"Test"}

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @MrAl 

     

    See my video tutorial.

     

    Power Automate - SharePoint Loop Through All Sub-Sites Under a Site Collection - YouTube

     

    Thanks

  • MrAl Profile Picture
    37 on at

    Hi @abm 

    This is exactly what I needed!  Many thanks for the video.

     

    Al

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard