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
Microsoft
Microsoft

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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (2,476)