cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlbertoSP
Level: Powered On

Run flow only on modified SharePoint item

Hi,

I'm starting to convert some (the simplest) InfoPath forms and SPD flows to PowerApps and Flow.

In SPD when an item is modified, the workflow runs only on that item and not on all the items in the list. 

Which flow choice should I use or what method is used to run the flow only when the specific item is modified?

 

6 REPLIES 6
Community Support Team
Community Support Team

Re: Run flow only on modified SharePoint item

Hi @AlbertoSP,

 

If I understand it, it seems that you want to monitor whether a specified item has changed.

You could use When an item is created or modified as the trigger, and then use Condition to determine whether the changed item is the specified one.

You could use the Item ID as the basis for the judgment. The ID is a field with a unique value in the list.

Expression:

@and(equals(triggerBody()?['ID'], 2),not(equals(triggerBody()?['Created'], triggerBody()?['Modified'])))

91.PNG90.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlbertoSP
Level: Powered On

Re: Run flow only on modified SharePoint item

That's not specific enough of a trigger. I have a list with hundreds of items and there could be many actions taken by many users every day. What I'm looking for is a trigger or a workflow that would start only if the item that is being modified.

If I'm to have tens of thousands of items (as some of my lists do), if would crush searching for those items.

Community Support Team
Community Support Team

Re: Run flow only on modified SharePoint item

Hi @AlbertoSP,

 

Currently, Flow does not exist a trigger that would start only if the item that is being modified.

I am afraid that your needs cannot be achieved currently.

If you want to the feature that you mentioned to be supported in Microsoft Flow, you could vote for the similar idea in the forum below:

https://powerusers.microsoft.com/t5/Flow-Ideas/Setting-a-When-an-item-is-modified-trigger/idi-p/1643...

Also you could post your idea in the Flow Ideas forum, so it might be considered for future releases.

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlbertoSP
Level: Powered On

Re: Run flow only on modified SharePoint item

The work around triggering workflows only when an item is modified is 1. To use " When an existing item is modified" SharePoint workflow 2. In my Power Apps I set a field called StartWF to Yes on Start 3. In the workflow when I update the field I set the StartWF to No 4. The first action of the workflow is to check the value of StartWF. If Equal No, then terminate. As a result the workflow will run twice an will end without causing any issues. Not ideal but it works.
Mike2500
Level 8

Re: Run flow only on modified SharePoint item

I think there's some confusion here. The trigger mentioned in other answers will only run for the item that was created/modified, and will not run for all items on the list. So if there are 1000 items, and you add one more, the flow will run just for that one item. If you add 1000 items, then yes, the flow will run for all 1000 items (though, using the condition provided, the flow could then immiately exit for those items, since they were created and not modified).

 

AlbertoSP
Level: Powered On

Re: Run flow only on modified SharePoint item

Yes and No 🙂 If the workflow updates any field value (title for example), the Newly Created Item will be treated as Modified and the the rest of the action in the workflow will act on. If you don't have any condition to terminate it, the workflow will run on that item in an infinite loop.

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,547)