Power Automate SharePoint Trigger Conditions: Ready-to-Use Formulas for Text, Date & User Fields
Following up on my previous article, I’ve put together a comprehensive collection of trigger condition formulas for different SharePoint list column types – text, numbers, dates/times, user columns, and many others.
For this demonstration, I’ll be using the following SharePoint list:
Testing with the “When an item is created” trigger:
While the “When an item is created or modified” trigger works for both item creation and editing:
The “When an item is deleted” trigger won’t work with these conditions:
This is because the “When an item is deleted” trigger contains only minimal information, making it impossible to write conditions targeting specific columns.
* However, you can still create trigger conditions based on “deleted by” or “deletion time” information.
Text Columns
Let’s start with text columns (single line of text and multiple lines of text).
// Match
@equals(triggerOutputs()?['body/[ColumnName]'], 'String')
// Example: Start the flow if the "Title" column is "abc"
@equals(triggerOutputs()?['body/Title'], 'abc')
// Contains
// * Note: Since "contains" does not accept null, add a null check with "and"
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]'], 'String')
)
// Example: Start the flow if the "Title" column contains "abc"
@and(
not(empty(triggerOutputs()?['body/Title'])),
contains(triggerOutputs()?['body/Title'], 'abc')
)
// The same applies to multi-line text columns
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]'], 'String')
)
// Example: Start the flow if the "multipleText" column contains "def"
@and(
not(empty(triggerOutputs()?['body/multipleText'])),
contains(triggerOutputs()?['body/multipleText'], 'def')
)
Number Columns
Next, let’s look at number columns.
// Equal
@equals(triggerOutputs()?['body/[ColumnName]'], Value)
// Example: Trigger when the number column "num" is 3 or more
@equals(triggerOutputs()?['body/num'], 3)
// Wrap with not for inequality (in this case, it also works if the number column is empty (null))
@not(equals(triggerOutputs()?['body/num'], 3))
// Greater than or equal to
@greaterOrEquals(triggerOutputs()?['body/[ColumnName]'], Value)
// Example: Trigger when the number column "num" is 3 or more
@greaterOrEquals(triggerOutputs()?['body/num'], 3)
// Less than or equal to
@lessOrEquals(triggerOutputs()?['body/[ColumnName]'], Value)
// Example: Trigger when the number column "num" is 3 or less
@lessOrEquals(triggerOutputs()?['body/num'], 3)
Yes/No Columns
Yes/No columns:
// To trigger the flow when the value is "Yes"
@equals(triggerOutputs()?['body/[ColumnName]'], true)
// Example: Trigger only when the Yes/No column "bool" is true
@equals(triggerOutputs()?['body/bool'], true)
// To trigger the flow when the value is "No"
@equals(triggerOutputs()?['body/[ColumnName]'], false)
Choice Columns
// Trigger the flow when a specific choice is selected
@equals(triggerOutputs()?['body/[ColumnName]/Value'], 'Choice')
// Example: Trigger when the choice column "choices" is "Choice 1"
@equals(triggerOutputs()?['body/choices/Value'], 'Choice 1')
// To trigger for multiple choices, wrap with or
@or(
equals(triggerOutputs()?['body/[ColumnName]/Value'], 'Choice 1'),
equals(triggerOutputs()?['body/[ColumnName]/Value'], 'Choice 2')
)
// To trigger when a choice other than a specific one is selected, wrap with not
// * With the formula below, it also triggers when the choice column is empty (null)
@not(equals(triggerOutputs()?['body/[ColumnName]/Value'], 'Choice'))
Date and DateTime Columns
Next, let’s cover date and dateTime columns.
* All examples in this section use Japan Standard Time (JST) for the condition formulas. Setting SharePoint to JST makes it easier to verify trigger condition behavior.
Date Only
For columns that don’t include time:
// On or after (use "@greater" for strictly after)
@greaterOrEquals(triggerOutputs()?['body/[ColumnName]'], 'Date (yyyy-MM-dd)')
// Example: Trigger the flow if the date column "date" is on or after 2025/1/1
@greaterOrEquals(triggerOutputs()?['body/date'], '2025-01-01')
// On or before (use "@less" for strictly before)
@lessOrEquals(triggerOutputs()?['body/[ColumnName]'], 'Date (yyyy-MM-dd)')
// Example: Trigger the flow if the date column "date" is on or before 2025/1/1
@lessOrEquals(triggerOutputs()?['body/date'], '2025-01-01')
// For a range, wrap with and (example: 2025/1/1 to 2025/1/31)
@and(
greaterOrEquals(triggerOutputs()?['body/date'], '2025-01-01'),
lessOrEquals(triggerOutputs()?['body/date'], '2025-01-31')
)
// For outside of a range, wrap with or (example: up to 2024/12/31, from 2025/2/1)
@or(
lessOrEquals(triggerOutputs()?['body/date'], '2024-12-31'),
greaterOrEquals(triggerOutputs()?['body/date'], '2025-02-01')
)
// Equal
@equals(triggerOutputs()?['body/[ColumnName]'], 'Date (yyyy-MM-dd)')
// Example: Trigger the flow if the date column "date" is 2025/1/1
@equals(triggerOutputs()?['body/date'], '2025-01-01')
Date and Time
For columns that include time:
// On or after (use "@greater" for strictly after), you can also use addHours to add +9 hours instead of convertTimeZone
// * Does not work if the date-time column is empty (Null)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 's'),
'DateTime (yyyy-MM-ddTHH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is on or after "2025/1/1 09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-01T09:00:00'
)
)
// * The following does not work correctly
@greaterOrEquals(triggerOutputs()?['body/dateTime'], '2025-06-04T09:00:00+09:00')
// On or before (use "@less" for strictly before)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 's'),
'DateTime (yyyy-MM-ddTHH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is on or before "2025/1/1 09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-01T09:00:00'
)
)
// For a range, wrap with and
// Example: When the column "dateTime" is between "2025/1/1 9:00" and "2025/1/31 18:00"
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-01T09:00:00'
),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-31T18:00:00'
)
)
// For outside the range, wrap with or
// Example: When the column "dateTime" is before "2025/1/1 9:00" or after "2025/1/31 18:00"
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
or(
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-01T09:00:00'
),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-31T18:00:00'
)
)
)
// Equal (rarely used)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
equals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 's'),
'DateTime (yyyy-MM-ddTHH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is exactly "2025/1/1 09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
equals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 's'),
'2025-01-01T09:00:00'
)
)
Time Only
When you want to write trigger conditions for datetime columns that ignore the “date” portion and focus only on the time component.
// On or after (use "@greater" for strictly after)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'Time (HH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is on or after "09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'09:00:00'
)
)
// On or before (use "@less" for strictly before)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'Time (HH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is on or before "09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'09:00:00'
)
)
// For a time range, wrap with and
// Example: When the column "dateTime" is between "09:00" and "18:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'09:00:00'
),
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'18:00:00'
)
)
// For outside the time range, wrap with or
// Example: When the column "dateTime" is before "09:00" or after "18:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
or(
lessOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'09:00:00'
),
greaterOrEquals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'18:00:00'
)
)
)
// Equal (rarely used)
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
equals(
convertTimeZone(triggerOutputs()?['body/[ColumnName]'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'Time (HH:mm:ss)'
)
)
// Example: Trigger the flow if the date-time column "dateTime" is exactly "09:00" Japan time
@and(
not(empty(triggerOutputs()?['body/dateTime'])),
equals(
convertTimeZone(triggerOutputs()?['body/dateTime'], 'UTC', 'Tokyo Standard Time', 'HH:mm:ss'),
'09:00:00'
)
)
User Columns
Finally, let’s look at user columns.
* Department and job title information can be configured in the admin center.
// DisplayName matches
// * Does not work if the user column is empty (null)
@equals(triggerOutputs()?['body/[ColumnName]']?['DisplayName'], 'User Name')
// Example: The DisplayName of the user column "user" is "John Smith"
@equals(triggerOutputs()?['body/user']?['DisplayName'], 'John Smith')
// DisplayName contains a specific string
// Since contains does not accept null, add a null check with and
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]']?['DisplayName'], 'Specific String')
)
// Example: Trigger the flow if the DisplayName of the user column "user" contains "John"
@and(
not(empty(triggerOutputs()?['body/user'])),
contains(triggerOutputs()?['body/user']?['DisplayName'], 'John')
)
// Email matches
@equals(triggerOutputs()?['body/[ColumnName]']?['Email'], 'Email Address')
// Example: Trigger the flow if the Email of the user column "user" is "TestUser@sample.com"
@equals(triggerOutputs()?['body/user']?['Email'], 'TestUser@sample.com')
// Email contains a specific string
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]']?['Email'], 'Specific String')
)
// Example: Trigger the flow if the Email of the user column "user" contains "TestUser"
@and(
not(empty(triggerOutputs()?['body/user'])),
contains(triggerOutputs()?['body/user']?['Email'], 'TestUser')
)
// Department matches
@equals(triggerOutputs()?['body/[ColumnName]']?['Department'], 'Department Name')
// Example: Trigger the flow if the Department of the user column "user" is "Sales Department Section 1"
@equals(triggerOutputs()?['body/user']?['Department'], 'Sales Department Section 1')
// Department contains a specific string
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]']?['Department'], 'Specific String')
)
// Example: Trigger the flow if the Department of the user column "user" contains "Sales Department"
@and(
not(empty(triggerOutputs()?['body/user'])),
contains(triggerOutputs()?['body/user']?['Department'], 'Sales Department')
)
// JobTitle matches
@equals(triggerOutputs()?['body/[ColumnName]']?['JobTitle'], 'Job Title')
// Example: Trigger the flow if the JobTitle of the user column "user" is "Manager"
@equals(triggerOutputs()?['body/user']?['JobTitle'], 'Manager')
// JobTitle contains a specific string
@and(
not(empty(triggerOutputs()?['body/[ColumnName]'])),
contains(triggerOutputs()?['body/[ColumnName]']?['JobTitle'], 'Specific String')
)
// Example: Trigger the flow if the JobTitle of the user column "user" contains "Manager"
@and(
not(empty(triggerOutputs()?['body/user'])),
contains(triggerOutputs()?['body/user']?['JobTitle'], 'Manager')
)
コメント