Stage 9 of 17
4 scheduled Power Automate flows: EOL Reminder, Contract Review Reminder, Missing Owner Notification, and Risk Review Reminder. Full action-by-action build instructions with expressions and test scenarios.
Note
DToDLab020-EOLReminder
Notifies the Technical Owner when a Technology component's EOL Date is within 90 days, or when it has passed EOL.
Actions
Recurrence trigger
Frequency: Day. Interval: 1. Start time: 08:00 UTC.
List rows — Technology table
Filter: EOL Date is not empty AND EOL Status is not equal to "Supported". This retrieves all Technology records that have an EOL Date and are not already marked Supported.
Apply to each — Technology row
Loop over each Technology record returned.
Condition: Is EOL within 90 days or past?
Expression: addDays(utcNow(), 90) is greater than or equal to item()?['dtod_eoldate']. This checks if today + 90 days is on or after the EOL Date — meaning the EOL Date is within the next 90 days (or already past).
If Yes — Get related Application
Get row by ID — Application table. Row ID: item()?['_dtod_application_value']. This retrieves the Application record linked to this Technology.
If Yes — Get Technical Owner
Get row by ID — Technical Owner table. Row ID: Application?['_dtod_technicalowner_value']. This retrieves the Technical Owner of the Application.
If Yes — Send an email (V2)
To: Technical Owner email. Subject: "EOL Alert: [Component Name] on [Application Name]". Body: Component name, application name, EOL date, EOL status, link to the Technology record in the app, and a link to the Application record.
If No — Do nothing
No action required. The component is not approaching EOL.
Test Scenario
Set the EOL Date on a Technology record to today + 30 days. Run the flow manually. Verify the Technical Owner receives an email. Then set the EOL Date to today + 100 days and run again — no email should be sent.
Design Notes
This flow runs daily. If a component has been past EOL for months, the Technical Owner will receive a daily email until the EOL Status is updated to "Past EOL" and a Replacement Plan is documented. Consider adding a condition to suppress the email if a Replacement Plan already exists.
DToDLab020-ContractReviewReminder
Notifies the Contract Owner and Procurement Director at three points before a contract renewal deadline: (Notice Period + 30 days), (Notice Period), and 30 days before End Date.
Actions
Recurrence trigger
Frequency: Day. Interval: 1. Start time: 08:00 UTC.
List rows — Contract table
Filter: Status = "Active". Retrieves all active contracts.
Apply to each — Contract row
Loop over each active Contract record.
Calculate three reminder dates
Use Compose actions to calculate: Reminder1 = End Date minus Notice Period minus 30 days. Reminder2 = End Date minus Notice Period. Reminder3 = End Date minus 30 days. Expression example for Reminder1: addDays(item()?['dtod_enddate'], mul(-1, add(item()?['dtod_noticeperioddays'], 30)))
Condition: Is today one of the three reminder dates?
Expression: or(equals(formatDateTime(utcNow(), 'yyyy-MM-dd'), formatDateTime(outputs('Reminder1'), 'yyyy-MM-dd')), equals(formatDateTime(utcNow(), 'yyyy-MM-dd'), formatDateTime(outputs('Reminder2'), 'yyyy-MM-dd')), equals(formatDateTime(utcNow(), 'yyyy-MM-dd'), formatDateTime(outputs('Reminder3'), 'yyyy-MM-dd')))
If Yes — Get Contract Owner
Get row by ID — Business Owner table. Row ID: item()?['_dtod_contractowner_value'].
If Yes — Send email to Contract Owner
To: Contract Owner email. Subject: "Contract Review Required: [Contract Name]". Body: Contract name, supplier, application, contract value, end date, notice period, days to renewal, and a link to the Contract record.
If Yes — Send email to Procurement Director
To: helena.marsh@contoso.co.uk (hardcoded — or use an environment variable). Same body as Contract Owner email.
Test Scenario
Set a Contract's End Date to today + Notice Period + 30 days (so Reminder1 fires today). Run the flow manually. Verify both the Contract Owner and Helena Marsh receive emails. Check the email body contains the correct contract details.
Design Notes
The Procurement Director email is hardcoded in this implementation. In a production system, use an environment variable so the email address can be changed without editing the flow. See Stage 13 (Release) for environment variable configuration.
DToDLab020-MissingOwnerNotification
Notifies the IT Team Lead of any Application records where the Business Owner or Technical Owner lookup is empty.
Actions
Recurrence trigger
Frequency: Week. Interval: 1. On these days: Monday. Start time: 08:00 UTC.
List rows — Application table
Filter: Status = "Active" AND (Business Owner is empty OR Technical Owner is empty). OData filter: dtod_status eq 1 and (_dtod_businessowner_value eq null or _dtod_technicalowner_value eq null). Note: Status choice values are stored as integers in Dataverse — check the exact integer for "Active" in your environment.
Condition: Are there any missing owner applications?
Expression: greater(length(body('List_rows')?['value']), 0). Checks if the list returned any rows.
If Yes — Build the email body
Use a Select action to extract Application Name from each row. Then use a Join action to create a comma-separated list of application names.
If Yes — Send email to IT Team Lead
To: t.reeves@contoso.co.uk (or environment variable). Subject: "Action Required: Applications with Missing Owners". Body: "The following Active applications have no Business Owner or Technical Owner assigned: [list of application names]. Please assign owners in the Application Portfolio system."
If No — Do nothing
All active applications have owners. No action required.
Test Scenario
Create an Application record with Status = Active and leave Business Owner empty. Run the flow manually. Verify the IT Team Lead receives an email listing that application. Then assign a Business Owner and Technical Owner and run again — no email should be sent.
Design Notes
This flow runs weekly rather than daily to avoid alert fatigue. A missing owner is a data quality issue, not an emergency. The IT Team Lead should review the list each Monday morning and assign owners before the next weekly run.
DToDLab020-RiskReviewReminder
Notifies the Risk Owner when a Risk record's Next Review Date is within 14 days.
Actions
Recurrence trigger
Frequency: Day. Interval: 1. Start time: 08:00 UTC.
List rows — Risk table
Filter: Mitigation Status is not equal to "Mitigated" AND Mitigation Status is not equal to "Accepted" AND Next Review Date is not empty. Retrieves all open risks with a review date.
Apply to each — Risk row
Loop over each Risk record.
Condition: Is Next Review Date within 14 days?
Expression: lessOrEquals(item()?['dtod_nextreviewdate'], addDays(utcNow(), 14)). Checks if the Next Review Date is on or before today + 14 days.
If Yes — Get Risk Owner
Get row by ID — Technical Owner table. Row ID: item()?['_dtod_riskowner_value'].
If Yes — Get related Application
Get row by ID — Application table. Row ID: item()?['_dtod_application_value'].
If Yes — Send email to Risk Owner
To: Risk Owner email. Subject: "Risk Review Due: [Risk Title]". Body: Risk title, application name, risk score, mitigation status, next review date, and a link to the Risk record.
If Yes — Condition: Is Risk Score ≥ 15?
Expression: greaterOrEquals(item()?['dtod_riskscore'], 15). High-risk items also notify the IT Team Lead.
If High Risk — Send email to IT Team Lead
To: t.reeves@contoso.co.uk. Subject: "High Risk Review Due: [Risk Title] (Score: [Risk Score])". Same body as Risk Owner email, plus: "This risk has a score of [Risk Score] and requires escalation."
Test Scenario
Set a Risk record's Next Review Date to today + 7 days and Mitigation Status to "In Progress". Run the flow manually. Verify the Risk Owner receives an email. Set Risk Score to 20 and run again — verify both the Risk Owner and IT Team Lead receive emails.
Design Notes
High-risk items (score ≥ 15) trigger two emails: one to the Risk Owner and one to the IT Team Lead. This implements the escalation requirement from the Process stage. The IT Team Lead email uses a different subject line so it is easy to filter in Outlook.
OData Filter Syntax for Dataverse
_columnname_value (with underscores and _value suffix). Choice columns store integer values, not text labels — check the integer value for each choice option in the column definition. Null checks use eq null not eq "".Need more help with the concepts?
Visit DosToDigital for guides, templates, and deeper explanations.