cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

how to check if item is edited or new item

flow reqiirements.png

Hi friends,

we have a requirement on sharepoint list.

we need to write a flow for above requirement.

1. When user add an item flow has to trigger an email for approval.

2. In between approvals, if user edit the item flow has to terminate no more action required from approvals

 

I have completed some part till send aprovals emails,

but dont know how to check if item is edited/modified then terminate flow instance.

kindly help me

 

Thanks,

Murali 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Hi @muralikrishna00 

 

Currently there is no direct way of cancelling a flow like that. You can use the terminate action but then depends on the scenario that you are trying to build. For example: Trigger: When an item is created-> flow is running. Maybe in between you can add a delay and use the get item action to get this item and check the modified vs created date and then use the terminate action to kill the flow. makes sense? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Community Support
Community Support

Hi @muralikrishna00 ,

 

As @yashag2255 said, there is no any way to close a flow when it has run.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User III
Dual Super User III

There really isn't a way to check whether something has been re-edited while the Flow is running. You can check if an item that triggered a Flow is new or edited by comparing the Created and Modified dates.  If they are the same then its new, otherwise its edited. But that would be in a different Flow and there would be no way to cancel an existing Approval in a different Flow from that Flow.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

First of all Really thanks for your reply,

 

"You can check if an item that triggered a Flow is new or edited by comparing the Created and Modified dates.  If they are the same then its new, otherwise its edited"

 

Ok it seems really good idea.

But 

after comparison can i stop current item instance ..?

Example 

New item is added 

Approver 1 is approved 

Approver 2 is approved 

Approver 3 is Pending(Not yet)

In this case can we terminate/stop/cancel the item flow instace ...?

means when approver 3 is couple of days back to approve (opned link) by any chance can we get error or no task list to approve since he modified.

kindly reply with your idea here if possible just give me a flow(attach that flow image) that make sence to me follow.

Thanks,

Murali krishna.

Highlighted

Hi @muralikrishna00 

 

Currently there is no direct way of cancelling a flow like that. You can use the terminate action but then depends on the scenario that you are trying to build. For example: Trigger: When an item is created-> flow is running. Maybe in between you can add a delay and use the get item action to get this item and check the modified vs created date and then use the terminate action to kill the flow. makes sense? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Community Support
Community Support

Hi @muralikrishna00 ,

 

As @yashag2255 said, there is no any way to close a flow when it has run.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

YOu can set a timeout on the Approvers and take action after that timeout fires.  But as I said, there is no way within that Flow running the approval to know that the document has been modified. When a trigger fires, yes you can compare the dates and terminate the Flow if its not a new document. But this would be in a different Flow than the original one sending out the Approvals. So I don't think that will be of any use to you.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,436)