cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WayneS84
Frequent Visitor

When an item or file is modified - run once?

Hi All 

 

I'm new to Power Automate, I've created a flow that allows a planner task to be created when a person field is modified in MS Lists/SharePoint using the "When an item or file is modified" function, however, it creates a new task each time the field is modified. I only want the flow to run once, this is to avoid task duplication in planner. Can anyone tell me how to achieve this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
zaphod88
Responsive Resident
Responsive Resident

Depending on how many fields you have in your task list, you could also try to see if there already is a task with the title from Sharepoint List by listing the tasks and filtering the resulting array by a field value from SP list.

zaphod88_0-1619896169056.png

zaphod88_0-1619896510938.png

Condition formula is 

 

length(body('Filter_array'))

 

 

 

and Update Task Id is

 

items('Apply_to_each')?['Id']

If you do it like that, you're not in need of an additional column.

 

View solution in original post

3 REPLIES 3
DamoBird365
Super User
Super User

Hi @WayneS84 

 

I believe that the easiest way to do this is to have a second column to record that you have processed that item.  If you turn concurrency for your trigger ON and limit parallelism to 1 and also introduce a trigger condition @empty(triggerOutputs()?['body']?['NewColum']) you can prevent unnecessary triggering of your flow.

 

DamoBird365_1-1619894262163.png

 

You would need to introduce an action that udpates the item column to indicate that it's been processed.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 

 

zaphod88
Responsive Resident
Responsive Resident

Depending on how many fields you have in your task list, you could also try to see if there already is a task with the title from Sharepoint List by listing the tasks and filtering the resulting array by a field value from SP list.

zaphod88_0-1619896169056.png

zaphod88_0-1619896510938.png

Condition formula is 

 

length(body('Filter_array'))

 

 

 

and Update Task Id is

 

items('Apply_to_each')?['Id']

If you do it like that, you're not in need of an additional column.

 

WayneS84
Frequent Visitor

Thanks both, the second solution works very well and also allows me to update the update rather than just have it run once. Perfect! Thanks for your help!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,042)