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 / Using Power Automate t...
Power Automate
Unanswered

Using Power Automate to Manage the Lifecycle of SharePoint Sites

(0) ShareShare
ReportReport
Posted on by

Hello everyone, 

 

I'm fairly new to Power Automate, and Power Platform in general, so I apologize in advance if my question may be too obvious or something similar. 

 

Currently, I'm trying to implement some sort of a lifecycle management solution for SharePoint Online sites. Before anyone suggests it, yes, I know about Microsoft Syntex. Unfortunately, it's a paid feature, and we have tons of users in my org and licensing all of them would simply be too much. That's why I've started researching options for doing this through Power Automate.

 

Basically, I want to have a list that contains following columns:

  • SiteName 
  • SiteURL
  • RetentionDays
  • RemainingDays
  • MarkedforDeletion (choice field with options "Yes", "No" and "PendingApproval")
  • DeletedOn
  • Approver (person field)

This list would be used by my flow to connect to and, based on retention and remaining days, it would either send an email to the approver (if remaining days = 0) or simply decrement retention days (if remaining days /= 0).  Based on the approver decision, it would further mark the site for deletion by changing the choice in MarkedforDeletion column if approver approves the email, or if approver rejects it, simply reset the remaining days to the value of retention days. Here's how the list looks:

 

list.png

 

So far, my flow looks like this:

 

Screenshot 2024-02-29 163028.png

It's a scheduled flow set to run once per day. 

By using the Get Items, it connects to the SharePoint Online site that stores my list.

After that, it's coming to a condition that checks the RemainingDays column.

If the column value is equal to 0, it should, using Update Item, change the MarkedforDeletion column to "PendingApproval".

If the column value is not equal to 0, it should, again using Update Item, decrement the number of remaining days by subtracting 1 day from the value of retention days (for example, if retention days is set to 10, it should be 10-1), and set the MarkedforDeletion column to "No". 

 

I haven't even gotten to the "If no", part of the condition and I'm already stuck. 

I manually set the value of remaining days field to 0 to see if the flow will change the MarkedforDeletion column to "PendingApproval", and I'm receiving this error: 

 

error.png

 

Flow does run successfully, but it doesn't update my MarkedforDeletion column. It just fallbacks to the "If no" option. 

 

Bonus question is this: I haven't gotten to the point to set any logic behind decrementing the number of days if the RemainingDays value is not 0, and to be honest, I don't really know how I would to that. I tried using the sub() function, but as far as I know, I can only provide number values there and my idea requires something a bit more complex. It would need to subtract 1 day each day from the value of RetentionDays.

 

If any further clarification or info is needed, let me know.

So, if anyone can assist me on this, or point me in the right direction, I would highly appreciate it. 

 

Thanks in advance!

Categories:
I have the same question (0)

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,027

#2
Valantis Profile Picture

Valantis 809

#3
Haque Profile Picture

Haque 645

Last 30 days Overall leaderboard