cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
muralikrishna00
Helper I
Helper I

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

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

v-alzhan-msft
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

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

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.

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.

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!

v-alzhan-msft
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.

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.
MikeInCairns
Helper I
Helper I

You CANNOT compare Created date and modified date if your new item has attachments.  Adding attachment to a new item seems to create a delay such that created DOES NOT EQUAL modified.  Furthermore you cannot test if item is new by testing the version.  A new item with 2 attachments will automatically start as version 3.

Helpful resources

Announcements
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

June 14th PVA AMA Carousel (up on May 25th, take down June 15th) (1).png

Join us on June 14th!

We're excited to announce the first Power Virtual Agents AMA on June 14, 2022!

Users online (2,400)