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 / Delete links from a li...
Power Automate
Answered

Delete links from a list on 404

(0) ShareShare
ReportReport
Posted on by 23

I've searched the forum a number of times but haven't found the solution I need, I am now posting. I'm very new to flow, therefore still very much learning, please go easy on me. 

 

I have a hub site with about 400 sub sites hanging off of it. On the parent site I have an index list with all of the subsites urls on it.

 

Ideally what I would like to happen is when a subsite is deleted, I would like the entry deleted from the index. If that's not possible then I would settle for a daily email to tell me if any url in my index no longer responds because it's been deleted. 

 

Thanks in advance for the help. 

Categories:
I have the same question (0)
  • Jay-Encodian Profile Picture
    2,920 on at

    Hey @mikeparkie 

    There isn't standard trigger (which I know of! :)) which captures a site deletion event / site disassociation event.

    I've setup this quick flow which does what you need:

    2.png

    1. Trigger Action - Schedule... the Flow will start on the defined schedule.

    2. Get Items: This queries for all the items in your list containing the site urls

    2.a. I have setup an example list as follows:

    1.png

    3. For Each: Add a for each loop to cycle through the items

    4. 'Send an HTTP Request to SharePoint' action: Select the relevant field from your SharePoint list item which contains the URL value... my field is called 'URL'

    4.a: Set the 'Uri' field to '_api/web/title'

    5. Add a 'Delete Item' action and pass the ID of the current item

    5.a 'Configure the run after settings to only run when the 'Send an HTTP Request to SharePoint' action fails... i.e. the site doesn't exist so delete it! 🙂

    3.png

     Run the Flow... an item with a valid Url will not be deleted: 

    1.pngan invalid entry will be deleted:

    2.png

     3.png

    HTH

    Jay

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     

     

     

     

     

  • mikeparkie Profile Picture
    23 on at

    Thanks for the very comprehensive response @Jay-Encodian, I'm almost there, got everything (almost working) on a test list. Decided to do an Update Item, just in case there were any issues...

     

    Only problem I have is that several of the links which said failed, presented me with "You need permission to access this site.".

    Now I don't know whether to trust the response. Because, if there's a valid working url BUT I don't have permission to access it, then am I going to get the same response as a deleted site (if you get where I'm coming from)? 

     

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

    Hey @mikeparkie 

    I can see the challenge... you could use the HTTP actions and then explore the status codes, messages, etc. but that will increase the complexity of the Flow and requires use of a premium connector.

    I'd suggest you create a service account... and then create a SharePoint connection which uses that specific account which is then used to access the sites... the benefit of this approach would be that you can grant the service account rights either directly to the sites or tenant.

    1.png

    HTH

    Jay

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • mikeparkie Profile Picture
    23 on at

    Noted, I'll see what else my colleagues are doing in the enterprise. Thanks again. 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 469

#3
11manish Profile Picture

11manish 364

Last 30 days Overall leaderboard