Trigger a Flow only if a specific user modified a SharePoint list item

If you want to proceed running actions in a Power Automate Flow only if a specific user did the change in a SharePoint list item, you can easily use a condition and manage that. But this will consume one Flow run from your daily runs allowance.

To do this before the Flow is executed, you can use Trigger conditions to achieve it. So the Flow will be triggered only if the formula specified as condition returns true.

How to do it?

To add trigger conditions, click the Settings button for your flow Trigger (in our case the SharePoint trigger ‘When an item is created or modified’.

Capture0

Then add a new condition with the following formula (replace the email address to your e-mail address in lowercase):

@equals(toLower(triggerBody()?[‘Editor’]?[‘Email’]),’user@domain.com’)

Capture

I’m using toLower here to avoid any mess related to character case (like user being User.Surname@domain.com instead of user.surname@domain.com). The syntax for the formula is the same for expressions inside a flow, the difference is that it should be preceded by @.

Also, I’m using the ‘Editor’ field to do the check based on who modified the item (will be the same as ‘Author’ for a new item). In case you want to check who created the item instead, use the ‘Author’ field.

The same approach can be used for the following SharePoint triggers in Power Automate too:

  • When an item is created
  • When a file is created (properties only)
  • When a file is created or modified (properties only)

To validate the behaviour, add any action to the flow like I’ve added below, and save it:

Capture4
Results

If you add or modify items with the user that was specified in the formula, the Flow is going to be normally triggered, as shown in the flow history.

Captureab

But if changes are done by someone else, the runs are skipped and nothing happens.

You can check the skipped runs from the flow history under the option ‘All Runs’:

Captureabc
And the view ‘Checks (no new data)’:

Captureabcd

Note that all checks done when an item is modified by a user that is not the one specified are marked as skipped.

By a simple tweak in the Flow trigger settings, it’s possible to avoid unnecessary flow run consumption from your user runs quota.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s