Here’s a collection of Power Automate trigger condition formulas that I personally use frequently or get asked about often.
Trigger Conditions
Power Automate trigger conditions are a feature that allows you to set conditions for when a trigger should execute.





In this article, I’ll compile the trigger condition processes that I personally use most frequently.
Date and Time

Day of the Week
Let’s start with days of the week. These are frequently used for flows that should run only on weekdays or only on weekends (like batch processes).
* Public holidays are difficult to handle with trigger conditions (while not impossible if you specify fixed values, it’s quite cumbersome…), so holidays are often filtered out using conditional logic within the flow itself.
// 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 of the week (in this example, Wednesday only) @equals(dayOfWeek(addHours(utcNow(), 9)), 3) // Result of dayOfWeek function: Sunday=0, Monday=1, Tuesday=2, Wednesday=3, Thursday=4, Friday=5, Saturday=6
Time
Next is time. These are commonly used for flows that should run during business hours or outside of business hours.
// Within business hours (in this example, business hours are from 09:00 to 18:00) @and( greaterOrEquals(addHours(utcNow(), 9, 'HH:mm'), '09:00'), // (Time must be in 24-hour format with leading zeros) lessOrEquals(addHours(utcNow(), 9, 'HH:mm'), '18:00') ) // Outside of business hours @or( less(addHours(utcNow(), 9, 'HH:mm'), '08:00'), greater(addHours(utcNow(), 9, 'HH:mm'), '18:00') )
Outlook
Next is Outlook. These are used for flows that should run only when the subject contains specific text, or when emails are received from specific senders.
// Only trigger for emails from a specific sender (in this example, sample@example.com) @equals(triggerOutputs()?['body/from'], 'sample@example.com') // If there are multiple specific email addresses @or( equals(triggerOutputs()?['body/from'], 'sample1@example.com'), equals(triggerOutputs()?['body/from'], 'sample2@example.com') ) // Only trigger for emails from a specific domain @endsWith(toLower(triggerOutputs()?['body/from']), '@example.com') // If there are multiple specific domains @or( endsWith(toLower(triggerOutputs()?['body/from']), '@example.com'), endsWith(toLower(triggerOutputs()?['body/from']), '@example.org') ) // Only trigger if the subject contains a specific keyword (in this example, "invoice") @contains(triggerOutputs()?['body/subject'], 'invoice')
SharePoint, OneDrive
For SharePoint and OneDrive, these are primarily used for flows that trigger only when files with specific extensions or files containing specific text in their names are uploaded to document libraries.
// Trigger only for specific file extensions (e.g., .pdf files) @endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.pdf') // Trigger only when filename contains specific text (e.g., "invoice") @contains(triggerOutputs()?['body/{FilenameWithExtension}'], 'invoice')
The following sections are for testing each formula. Please proceed if you’re interested.
Testing
Date and Time

Day of the Week




Time



* 22:11 was skipped due to the timing of saving the flow.

Outlook







SharePoint







コメント