Stage 9 of 17

Stage 9 of 17

Automate — Power Automate Warranty Alert

In this stage you will build the Power Automate warranty alert flow. This flow runs every morning, checks the Equipment Register for items with warranty expiry within 30 days, and sends a single summary email to the IT team. This is the core automation that transforms the register from a passive record into a proactive management tool.

Why Are We Doing This?

Automation is what makes a system genuinely useful rather than just a better spreadsheet. Without the warranty alert, the IT team still has to remember to check the register. With it, the system does the checking for them. This is the difference between a reactive and a proactive IT operation.

Flow Overview

Flow Name

DTOD-001 Warranty Alert

Business Purpose

Proactively notify the IT team of equipment with warranty expiry within 30 days, enabling action before warranties lapse.

Trigger

Scheduled — Recurrence (daily)

Run Time

08:00 UTC daily (09:00 BST / 08:00 GMT)

Alert Recipient

it-team@contoso.co.uk

Expected Outcome

Single email sent only on days when qualifying items exist. No email on days with no qualifying items.

Complete Flow — Step by Step

The following documents every action in the flow in the order they appear. Read through the complete flow before building it — understanding the whole before building the parts prevents mistakes.

1TriggerRecurrence

The flow starts automatically on a schedule. No manual trigger is needed.

Interval: 1

Frequency: Day

Start time: Set to a date in the past at 08:00:00 UTC (e.g. 2024-01-01T08:00:00Z)

Time zone: UTC

2ActionGet items — Equipment Register

Retrieves all items from the Equipment Register list. No filter is applied here — filtering is done in the condition inside the loop. This ensures all records are checked, including those added after the flow was created.

Site Address: Select your SharePoint site from the dropdown (e.g. https://[tenant].sharepoint.com/sites/ITTeam)

List Name: Equipment Register

Top Count: Leave blank (retrieves all items, up to the default limit of 100)

⚠ Important: If your list may exceed 100 items, set Top Count to 5000 and enable pagination in the action settings.

3VariableInitialize variable — WarrantyItems

Creates an empty array variable to collect the equipment items that meet the warranty alert criteria. This variable will be built up inside the loop and used to construct the email body.

Name: WarrantyItems

Type: Array

Value: Leave blank (empty array)

4LoopApply to each — value from Get items

Iterates over every item returned by the Get items action. The body of this loop (steps 5 and 6) runs once for each equipment record.

Select an output from previous steps: value (from the Get items action)

5ConditionCheck warranty criteria (inside Apply to each)

Evaluates whether the current item meets all three criteria for a warranty alert. All three conditions must be true.

Condition 1 — Warranty Expiry Date is not blank:

empty(items('Apply_to_each')?['Warranty_Expiry_Date'])

Set this condition to: is equal to false

Condition 2 — Warranty Expiry Date is within 30 days:

items('Apply_to_each')?['Warranty_Expiry_Date']

is less than or equal to:

addDays(utcNow(), 30)

Condition 3 — Status is not Retired or Disposed:

items('Apply_to_each')?['Status']

is not equal to: Retired

AND is not equal to: Disposed

6ActionAppend to array variable — WarrantyItems (Yes branch of condition)

If the item meets all three criteria, its details are added to the WarrantyItems array. This action runs only in the Yes branch of the condition.

Name: WarrantyItems

Value: Use the expression editor to build a formatted string for each item:

concat('• ', items('Apply_to_each')?['Title'], ' (', items('Apply_to_each')?['Asset_ID'], ') — Assigned to: ', if(empty(items('Apply_to_each')?['Assigned_To']?['DisplayName']), 'Unassigned', items('Apply_to_each')?['Assigned_To']?['DisplayName']), ' — Expires: ', formatDateTime(items('Apply_to_each')?['Warranty_Expiry_Date'], 'dd/MM/yyyy'))

This expression creates a formatted line for each qualifying item, e.g.:
• Dell XPS 15 Laptop (ASSET-0001) — Assigned to: James Okafor — Expires: 01/09/2026

7ConditionCheck if any items were found (after Apply to each)

After the loop completes, checks whether the WarrantyItems array contains any items. If it does, an email is sent. If it does not, the flow ends without sending an email.

Expression:

length(variables('WarrantyItems'))

is greater than: 0

8ActionSend an email (V2) — Yes branch

Sends the warranty alert email to the IT team mailbox. This action only runs when at least one qualifying item was found.

To: it-team@contoso.co.uk (replace with your IT team mailbox address)

Subject:

concat('⚠ Warranty Alert — ', length(variables('WarrantyItems')), ' item(s) expiring within 30 days')

Body:

concat('The following equipment items have warranty expiry dates within the next 30 days: ', join(variables('WarrantyItems'), ' '), ' Please review and take appropriate action before the warranty expires. This is an automated message from the Equipment Register.')

Importance: High

9ActionTerminate — No branch

If no qualifying items were found, the flow ends cleanly with a 'Succeeded' status. No email is sent. This is the expected outcome on most days.

Status: Succeeded

Comment: No warranty alerts today.

Expression Explanations

Why Understand Expressions?

Power Automate expressions are small formulas that calculate values at runtime. Understanding them means you can troubleshoot when they go wrong, adapt them for different scenarios, and build more sophisticated flows in the future.

empty(items('Apply_to_each')?['Warranty_Expiry_Date'])

Purpose

Checks whether the Warranty Expiry Date field is blank for the current item.

Explanation

The empty() function returns true if the value is null, empty string, or empty array. The ?['field'] syntax safely accesses a field — if the field does not exist, it returns null rather than throwing an error. We check this equals false, meaning the field has a value.

addDays(utcNow(), 30)

Purpose

Calculates the date 30 days from today.

Explanation

utcNow() returns the current date and time in UTC. addDays() adds the specified number of days. The result is a date 30 days in the future. We compare the Warranty Expiry Date against this value — if the expiry date is before or equal to this date, the item qualifies.

formatDateTime(items('Apply_to_each')?['Warranty_Expiry_Date'], 'dd/MM/yyyy')

Purpose

Formats the Warranty Expiry Date as a readable UK date (e.g. 01/09/2026).

Explanation

Power Automate stores dates in ISO 8601 format (e.g. 2026-09-01T00:00:00Z). The formatDateTime() function converts this to a human-readable format. The format string 'dd/MM/yyyy' produces day/month/year in UK format.

if(empty(items('Apply_to_each')?['Assigned_To']?['DisplayName']), 'Unassigned', items('Apply_to_each')?['Assigned_To']?['DisplayName'])

Purpose

Returns the assigned person's display name, or "Unassigned" if the field is blank.

Explanation

The if() function takes three arguments: a condition, a value if true, and a value if false. Here, if the Assigned To field is empty, we return the string "Unassigned". Otherwise, we return the DisplayName property of the People field. The ?['DisplayName'] syntax accesses the display name from the People column object.

join(variables('WarrantyItems'), '\n')

Purpose

Joins all items in the WarrantyItems array into a single string, with each item on a new line.

Explanation

The join() function concatenates all elements of an array with a separator. Here, the separator is '\n' (a newline character). This converts the array of formatted item strings into a single block of text suitable for the email body.

length(variables('WarrantyItems'))

Purpose

Returns the number of items in the WarrantyItems array.

Explanation

The length() function returns the count of elements in an array. We use this in two places: in the condition to check whether any items were found (length > 0), and in the email subject to show how many items are expiring.

Building the Flow in Power Automate

STEP A

Create a new flow

Navigate to make.powerautomate.com and sign in.

Select + Create from the left navigation.

Select Scheduled cloud flow.

Configure the schedule:

Flow name: DTOD-001 Warranty Alert

Starting: Today's date at 08:00:00

Repeat every: 1 Day

Select Create. The flow designer will open with the Recurrence trigger already added.

STEP B

Add the Get items action

Select + New step.

Search for SharePoint and select the SharePoint connector.

Select the action Get items.

Configure:

Site Address: Select your SharePoint site from the dropdown

List Name: Equipment Register

Beginner Tip

If your Equipment Register list does not appear in the List Name dropdown, type the name manually. The dropdown shows recently used lists — if you have not used the list in Power Automate before, it may not appear automatically.
STEP C

Add the Initialize variable action

Select + New step.

Search for Initialize variable and select it.

Configure:

Name: WarrantyItems

Type: Array

Value: Leave blank

STEP D

Add the Apply to each loop

Select + New step.

Search for Apply to each and select it.

In the "Select an output from previous steps" field, select value from the Get items action.

All subsequent steps (E, F) will be added inside this loop.

STEP E

Add the Condition inside the loop

Inside the Apply to each loop, select Add an action.

Search for Condition and select it.

Add three conditions using Add row and set the relationship to And:

Condition 1 — Warranty date is not blank

Left side: Select Expression and enter: empty(items('Apply_to_each')?['Warranty_Expiry_Date'])

Operator: is equal to

Right side: Select Expression and enter: false

Condition 2 — Warranty expires within 30 days

Left side: Select Dynamic content → Warranty Expiry Date

Operator: is less than or equal to

Right side: Select Expression and enter: addDays(utcNow(), 30)

Condition 3 — Status is not Retired or Disposed

Left side: Select Dynamic content → Status

Operator: is not equal to

Right side: Type Retired

Add another row: Status is not equal to Disposed

STEP F

Add the Append to array variable action (Yes branch)

In the Yes branch of the condition, select Add an action.

Search for Append to array variable and select it.

Name: WarrantyItems

Value: Select Expression and enter the full concat expression from Step 6 above.

Beginner Tip

Building the concat expression can be tricky. Type it carefully in the expression editor. If you get an error, check for mismatched quotes or brackets. The expression editor will show a red underline if the syntax is invalid. You can also build it in parts — start with just the asset name and add more fields once the basic expression works.
STEP G

Add the second Condition (after the loop)

After the Apply to each loop (outside it, not inside), select + New step.

Add a Condition.

Left side: Select Expression and enter: length(variables('WarrantyItems'))

Operator: is greater than

Right side: 0

STEP H

Add the Send an email action (Yes branch)

In the Yes branch of the second condition, add a Send an email (V2) action from the Office 365 Outlook connector.

To: Your IT team mailbox address

Subject: Enter the concat expression from Step 8 above

Body: Enter the concat/join expression from Step 8 above

Importance: High

STEP I

Add the Terminate action (No branch) and save

In the No branch, add a Terminate action.

Status: Succeeded

Comment: No warranty alerts today.

Select Save at the top of the flow designer. Wait for the save to complete — you will see a confirmation message.

How to Test the Flow

Why Test Before Going Live?

A flow that has never been tested is a flow that has never been verified. Testing confirms that the logic works, the expressions are correct, and the email arrives as expected. Do not rely on the scheduled run to discover problems.

Test Method 1 — Manual trigger

In the flow designer, select Test (top right). Choose Manually and select Test. The flow will run immediately using the current data in the Equipment Register.

Before testing, temporarily change the Warranty Expiry Date on one of your sample records to a date within the next 30 days (e.g. tomorrow's date). This ensures the flow has at least one qualifying item to find.

After the test, check your IT team mailbox for the alert email. Then restore the original warranty date.

Test Method 2 — Test with no qualifying items

Set all Warranty Expiry Dates to dates more than 30 days in the future (or leave them blank). Run the flow manually. Verify that no email is sent and the flow completes with "Succeeded" status via the Terminate action.

How to Inspect Run History

Power Automate keeps a history of every flow run. To inspect it:

  1. 1.Open the flow in Power Automate (My flows → select the flow).
  2. 2.Scroll down to the "28 day run history" section on the flow detail page.
  3. 3.Each row shows a run: the start time, duration, and status (Succeeded, Failed, or Running).
  4. 4.Select any run to open the run detail view.
  5. 5.In the run detail view, each action shows its inputs, outputs, and status. Expand any action to see exactly what data it processed.
  6. 6.For a failed run, the failed action will be highlighted in red. Expand it to see the error message.

Common Failure Conditions and Troubleshooting

Flow fails on "Get items" with "Access denied" error

Likely Cause

The account running the flow does not have permission to read the Equipment Register list.

Fix

Check that the account used to create the flow (the flow owner) has at least Read permission on the SharePoint site. Navigate to the SharePoint site → Settings → Site permissions and verify.

Flow runs but no email is sent, even when qualifying items exist

Likely Cause

The condition logic is incorrect, or the Warranty Expiry Date field name in the expression does not match the actual column internal name.

Fix

Open the run history and expand the Apply to each loop. Check the condition action — look at the inputs to see what values are being compared. The internal name of the Warranty Expiry Date column may be "Warranty_Expiry_Date" or "Warranty_x0020_Expiry_x0020_Date" depending on how it was created. Check the Get items output to find the exact field name.

Email is sent but the body shows blank values for some fields

Likely Cause

The field name in the concat expression does not match the actual internal column name.

Fix

In the run history, expand the Append to array variable action and look at the output. If a field shows as null or empty, the field name in the expression is wrong. Check the Get items output to find the correct internal name for each field.

Flow sends an email every day even when no items qualify

Likely Cause

The second condition (checking array length) is missing or incorrectly configured.

Fix

Check that the second condition is outside the Apply to each loop (not inside it). Verify that the expression length(variables('WarrantyItems')) is greater than 0 is correctly configured.

Flow fails with "The expression is invalid" error

Likely Cause

A syntax error in one of the expressions — mismatched quotes, brackets, or incorrect function names.

Fix

Open the failed action in the run history and look at the error message. It will usually indicate which expression failed. Return to the flow designer, find the action, and carefully check the expression for syntax errors.

Try It Yourself — Before Moving On

After building and testing the flow, answer these questions:

  1. 1.What does the empty() function return when the Warranty Expiry Date field has a value?
  2. 2.Why is the Terminate action in the No branch set to "Succeeded" rather than "Failed"?
  3. 3.What would happen if you removed the condition checking that Status is not Retired or Disposed?
  4. 4.Where in Power Automate do you go to see whether the flow ran successfully yesterday?
  5. 5.If the flow sends an email but the warranty dates are formatted as "2026-09-01T00:00:00Z" instead of "01/09/2026", which expression needs to be fixed?

Application Support View

The Power Automate run history is your first port of call when a user reports that the warranty alert email did not arrive. Check the run history for the expected run date — did the flow run? Did it succeed? If it ran and succeeded but no email was sent, the No branch was taken (no qualifying items). If it failed, the error message will tell you what went wrong.

Stage Complete — What You Now Have

  • ✓A working Power Automate warranty alert flow with all 9 actions configured
  • ✓Understanding of all 6 expressions used in the flow
  • ✓A tested flow that sends a summary email only when qualifying items exist
  • ✓Knowledge of how to inspect run history and diagnose failures
  • ✓Five common failure conditions and their fixes
NextSecure

Need more help with the concepts?

Visit DosToDigital for guides, templates, and deeper explanations.

DosToDigital
DToD Labs

Learn it. Build it. Make it work.

A DosToDigital Project

About DToD Labs

Practical technology learning for Microsoft 365 and Power Platform. Build real business solutions from real business problems.

Learn the concepts at DosToDigital. Put them into practice at DToD Labs.

DToD Labs provides practical learning projects for educational purposes. Microsoft services, interfaces, licensing and product capabilities change over time. Always check current Microsoft documentation and licensing before implementing a solution in a production environment. All organisations, business scenarios and data used in DToD Labs are fictional. Learners should not use confidential employer, customer or personal information when following DToD Labs exercises.

© 2026 DToD Labs — A DosToDigital Project