When an Item Is Modified Trigger Loops Forever: Root Cause and Fix
🔍 WiseChecker

When an Item Is Modified Trigger Loops Forever: Root Cause and Fix

You created a Power Automate flow that runs when a SharePoint item is modified. But instead of running once, the flow keeps triggering itself over and over. This creates an endless loop that can generate thousands of flow runs and slow down your site.

The root cause is a circular trigger: your flow modifies the same item it watches. Each modification triggers the flow again, which modifies the item again, and the cycle never stops. Power Automate does not detect or block this pattern automatically.

This article explains exactly why the loop happens and gives you two reliable fixes. You will learn how to stop active loops and how to redesign your flow so the loop never starts again.

Key Takeaways: Stopping and Preventing the Modified Trigger Loop

  • Power Automate trigger condition: Add a condition that skips the flow when the modifying user is the flow itself to break the loop.
  • Terminate action inside the flow: Use the Terminate action to stop a currently looping flow run before it modifies the item again.
  • SharePoint version history: Check the version history of the item to confirm which changes the flow is making and how many times.

ADVERTISEMENT

Why the Modified Trigger Creates an Infinite Loop

The loop occurs because of a simple cause-and-effect cycle:

  1. Your flow is configured with the trigger When an item is modified on a specific SharePoint list or library.
  2. When a user edits an item, the trigger fires and the flow runs.
  3. Inside the flow, you have an action that updates a column in that same item. For example, you set a Status column to “Approved” or add text to a Comments column.
  4. Power Automate sends the update to SharePoint. SharePoint records the change as a modification.
  5. Because the item was modified again, the trigger fires a second time. The flow runs again, and the update action runs again.
  6. This cycle repeats forever until you manually stop the flow or SharePoint throttles it.

Power Automate does not distinguish between a human making a change and the flow making a change. Both count as modifications. The trigger has no built-in filter to ignore changes made by the flow itself.

Another common cause is using the Update item action without checking whether the value already matches the target. If the flow always writes the same value, it still triggers a modification event even when nothing actually changed. SharePoint treats every write operation as a modification regardless of whether the data changed.

How to Stop an Active Loop Immediately

If your flow is currently looping, you must stop it before you can apply a permanent fix. Follow these steps to break the cycle.

  1. Turn off the flow
    Go to Power Automate, open your flow, and select Turn off. This stops new trigger events from starting. Existing runs in progress will continue until they finish or time out.
  2. Cancel running instances
    In the flow details page, go to the 28-day run history tab. Select any run that is still in progress. Choose Cancel to stop it. Repeat for all active runs.
  3. Check the item version history
    Open the SharePoint list or library. Select the affected item and choose Version history. You will see many versions created by the flow. This confirms the loop and shows you how many times it ran.
  4. Restore the item to a clean version
    In Version history, select the version before the loop started. Click Restore. This removes all the unwanted changes made by the flow.

After these steps, the loop is stopped. Do not turn the flow back on until you apply one of the fixes below.

ADVERTISEMENT

Fix 1: Add a Trigger Condition That Checks the Modified By Field

The most reliable fix is to add a trigger condition that prevents the flow from running when the modification was made by the flow itself. Power Automate runs under a service account named Microsoft Power Automate or Flow Owner depending on your environment. You can check the Modified By field of the item and skip the trigger if the modifier is that service account.

  1. Open your flow in edit mode
    Go to Power Automate and open the looping flow. Select Edit.
  2. Add a trigger condition
    Select the trigger card. In the top menu, choose Settings. Under Trigger Conditions, add the following expression:
    @not(equals(triggerOutputs()?['body/Editor/DisplayName'], 'Microsoft Power Automate'))
    If your environment uses a different service account name, replace Microsoft Power Automate with the actual display name.
  3. Save and test
    Save the flow. Modify an item manually to verify that the flow runs once. Then check that the flow does not run again when the update action completes.
  4. Alternative condition using Editor lookup
    If the display name does not match, use the Editor ID instead:
    @not(equals(triggerOutputs()?['body/Editor/Id'], 'i:0i.t|microsoft.sharepoint.teamservices|flow@sharepoint'))

This method works because it checks who made the last modification. If the flow made the change, the condition evaluates to false and the trigger does not fire.

Fix 2: Use a Compose Action and Conditional Logic to Avoid Unnecessary Updates

If you cannot use a trigger condition, redesign the flow to only update the item when the value actually changes. This prevents the loop even if the trigger fires again.

  1. Get the current item values
    Add a Get item action after the trigger. Use the item ID from the trigger output to retrieve the current column values.
  2. Compare the values
    Add a Compose action that checks if the target column already contains the value you want to write. For example, if you want to set Status to “Completed”, use this expression:
    @equals(outputs('Get_item')?['body/Status'], 'Completed')
  3. Add a Condition action
    Add a Condition action. Set it to check if the Compose output equals false. If the value is already set, the condition fails and the flow ends without updating.
  4. Place the Update item action inside the Yes branch
    Move your Update item action into the If yes branch of the Condition. This ensures the update only runs when the value is different.

This fix breaks the loop because the flow stops updating the item after the first run. The trigger may fire again, but the Condition prevents any further updates.

Common Issues After Applying the Fix

The flow still loops even with a trigger condition

The trigger condition expression may use the wrong field name or the service account display name does not match. Open the run history and look at the trigger outputs for a completed run. Find the Editor field and copy the exact display name. Update the expression with that name.

The flow stops working for legitimate user modifications

If the trigger condition is too restrictive, it may block all modifications. Test with a user account that is not the flow owner. If the flow does not run, remove the condition and use the compare-and-condition method instead.

The flow runs but the Update item action fails with a permission error

The flow service account must have edit permissions on the list or library. Go to SharePoint, open the list settings, and check Permissions for this list. Add the flow owner or the service account with Contribute level access.

Item Trigger Condition Method Compare-and-Condition Method
Setup complexity Low — one expression in trigger settings Medium — multiple actions and a Condition
Stops loop immediately Yes, by blocking the trigger No — trigger still fires but update is skipped
Works with any update action Yes Only if you can compare values before updating
Requires exact service account name Yes No
Best for Simple flows that always update the same column Complex flows with conditional updates

Use the trigger condition method when you want a quick, lightweight fix. Use the compare-and-condition method when you need more control over when updates happen.

You now know why the modified trigger loops and how to stop it. Turn off the looping flow immediately, apply one of the two fixes, and test with a manual edit. For future flows, always design them so the trigger and the update action cannot create a circular reference. A good practice is to use a separate list for logging changes instead of updating the same item that triggered the flow.

ADVERTISEMENT