Hello dKayt,
To solve this issue in SharePoint, you can use Power Automate to create a flow that automatically changes the status of all items to "inactive" once the last date is due.
Schedule the Flow: Set the flow to run daily (or at your preferred frequency).
Retrieve Items: Fetch all items from the SharePoint list.
Loop Through Each Item:
Compose Condition:
if( less( formatDateTime(items('Apply_to_each')['Date'], 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd') ), 'true', 'false' )
This checks if the item's date is earlier than the current date.
Condition Check:
Update Item:
I created and tested a workflow, and I recommend working with data that has a specific CustomerID.
Data Retrieval: First, I used the Get Items action to retrieve data with CustomerID 566.
Variable Initialization: Next, I added an "Initialize variable" step and defined this variable as an array.
Date Formatting: In the "Apply to each" step, I extracted the relevant dates using formatDateTime(items('Apply_to_each')?['Date']).
formatDateTime(items('Apply_to_each')?['Date'])
Identifying the Last Date: I added a Compose action, naming it "LastDate," to capture the most recent date using the expression formatDateTime(last(sort(variables('SortedDates'))), 'MM/dd/yyyy').
formatDateTime(last(sort(variables('SortedDates'))), 'MM/dd/yyyy')
Checking Today's Date: I added another Compose action named "CheckDateToday." In this step, I used the expression if(less(formatDateTime(outputs('LastDate'), 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd')), 'true', 'false') to check if today's date is less than or equal to LastDate.
if(less(formatDateTime(outputs('LastDate'), 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd')), 'true', 'false')
Adding a Condition: Finally, I included a Condition action that executes the necessary adjustments if the result of "CheckDateToday" is true.
By following these steps, you can create an effective workflow that processes data within a specific date range. I believe this approach can be useful in your own applications as well.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Chiara Carbone as our Community Spotlight for November…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 655 Super User 2025 Season 2
Tomac 371 Moderator
chiaraalina 276