Power Automate Trigger Condition Formulas Cheat Sheet: Ready-to-Use Examples for Business Hours & Email Filtering
Source: Dev.to
Trigger Conditions
Power Automate trigger conditions let you specify when a trigger should fire. In the new designer they’re available under the Settings tab, and in the classic designer under the Settings menu. The syntax is the same as the “Filter array” action in advanced mode.
Using trigger conditions prevents the flow from executing at all when the condition isn’t met, which reduces run counts and resource consumption.
Learn more about limits and configuration
Date and Time
Date‑and‑time formulas are most often used with Scheduled triggers.
// Example: add 9 hours to UTC now (adjust for your time zone)
addHours(utcNow(), 9)
Day of the Week
These formulas are handy for flows that should run only on weekdays, weekends, or a specific day.
// Only run from Monday to Friday
@and(
greaterOrEquals(dayOfWeek(addHours(utcNow(), 9)), 1),
lessOrEquals(dayOfWeek(addHours(utcNow(), 9)), 5)
)
// Only run on Saturday and Sunday
@or(
equals(dayOfWeek(addHours(utcNow(), 9)), 0),
equals(dayOfWeek(addHours(utcNow(), 9)), 6)
)
// Only run on a specific day (Wednesday)
@equals(dayOfWeek(addHours(utcNow(), 9)), 3)
Result of dayOfWeek: Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6.
Note: Public holidays are difficult to handle with trigger conditions; they’re usually filtered inside the flow instead.
Time
Use these formulas to restrict execution to business hours or outside them.
// Within business hours (09:00 – 18:00)
@and(
greaterOrEquals(addHours(utcNow(), 9, 'HH:mm'), '09:00'),
lessOrEquals(addHours(utcNow(), 9, 'HH:mm'), '18:00')
)
// Outside business hours
@or(
less(addHours(utcNow(), 9, 'HH:mm'), '08:00'),
greater(addHours(utcNow(), 9, 'HH:mm'), '18:00')
)
Time strings must be in 24‑hour format with leading zeros.
Outlook
Trigger conditions for email‑based flows.
// Only trigger for a specific sender
@equals(triggerOutputs()?['body/from'], 'sample@example.com')
// Multiple specific senders
@or(
equals(triggerOutputs()?['body/from'], 'sample1@example.com'),
equals(triggerOutputs()?['body/from'], 'sample2@example.com')
)
// Only trigger for a specific domain
@endsWith(toLower(triggerOutputs()?['body/from']), '@example.com')
// Multiple domains
@or(
endsWith(toLower(triggerOutputs()?['body/from']), '@example.com'),
endsWith(toLower(triggerOutputs()?['body/from']), '@example.org')
)
// Subject contains a keyword (e.g., "invoice")
@contains(triggerOutputs()?['body/subject'], 'invoice')
SharePoint & OneDrive
Restrict file‑based triggers to certain extensions or filename patterns.
// Only for .pdf files
@endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.pdf')
// Filename contains specific text (e.g., "invoice")
@contains(triggerOutputs()?['body/{FilenameWithExtension}'], 'invoice')
Testing
A quick way to verify each condition is to use a Scheduled trigger that runs every minute and observe whether the flow fires.
| Scenario | Test Setup | Expected Result |
|---|---|---|
| Weekday only | Use the “Monday‑to‑Friday” condition | Flow runs on Mon‑Fri, not on Sat‑Sun |
| Weekend only | Use the “Saturday‑and‑Sunday” condition | Flow runs on Sat‑Sun, not on weekdays |
| Business hours | Use the “09:00‑18:00” condition | Flow runs between 09:00 and 18:00 (local adjusted time) |
| Outside business hours | Use the “outside hours” condition | Flow runs before 09:00 or after 18:00 |
| Specific sender | Use the sender condition with sample@example.com | Flow triggers only when an email from that address arrives |
| Specific domain | Use the domain condition @example.com | Flow triggers only for emails from that domain |
| File extension | Use the .pdf condition on a SharePoint “When a file is created” trigger | Flow triggers only when a PDF is uploaded |
| Filename contains | Use the invoice condition on the same trigger | Flow triggers only for files whose name includes “invoice” |
During testing you may notice a one‑minute delay when saving the flow; this is normal because the trigger condition is evaluated after the flow is persisted.