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

Approval Loop in Flow

Hi,  I have a flow which triggers when a sharepoint item is created or modified.  Upon created an item in the list it is marked as pending.  When the manager approves or declines i want the item to say approved or declined.  However, when i try to do this, I start a loop, as it then thinks the file has been modified and emails the manager again.  Screenshot on the attachment.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Approval Loop in Flow

Hi @rickfear,

Do you want to get rid of the loop approvals within your flow?

Do you have enable the "Content Approval" option within the List Settings of your SP list?

Further, could you please share a bit more about your SP list?

Based on the screenshot that you provided, I think this issue is related to the "When an item is created or modified" trigger in your flow. When the "Update item" action in your flow executes, the "When an item is created or modified" trigger would be fired again.

In order to get rid of this issue, you could consider take a try to add a Yes/No type column (IsModified) in your SP list, the default value of the IsModified column is No. Then within your flow, before the "Start an approval" action, add a Condition to check if the IsModified column value is equal to No, if yes, send an approval email, if no, do nothing. Then within the "Update Item" action, set the IsModified field value to Yes.

I have made a test on my side, please take a try with the following workaround:

The data structure of my SP list as below:4.JPG

The Flow's configuration as below:5.JPG

 

6.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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
Community Support Team
Community Support Team

Re: Approval Loop in Flow

Hi @rickfear,

Do you want to get rid of the loop approvals within your flow?

Do you have enable the "Content Approval" option within the List Settings of your SP list?

Further, could you please share a bit more about your SP list?

Based on the screenshot that you provided, I think this issue is related to the "When an item is created or modified" trigger in your flow. When the "Update item" action in your flow executes, the "When an item is created or modified" trigger would be fired again.

In order to get rid of this issue, you could consider take a try to add a Yes/No type column (IsModified) in your SP list, the default value of the IsModified column is No. Then within your flow, before the "Start an approval" action, add a Condition to check if the IsModified column value is equal to No, if yes, send an approval email, if no, do nothing. Then within the "Update Item" action, set the IsModified field value to Yes.

I have made a test on my side, please take a try with the following workaround:

The data structure of my SP list as below:4.JPG

The Flow's configuration as below:5.JPG

 

6.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

rickfear
Level: Powered On

Re: Approval Loop in Flow

Require content approval is currently set to NO.

 

Attached is a screen shot of my list headers and an example from sharepoint.

 

I'll try adding the column as you auggested, and the condition, and see if that works.

Community Support Team
Community Support Team

Re: Approval Loop in Flow

Hi @rickfear,

Have you solved your problem?

If you have solved your problem, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify.

 

Best regards,

Kris

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

Re: Approval Loop in Flow

Hi sorry not quite finished yet. I have come across a situation where if an employee wants to go into an exisiting booking, and make changes, then it doesnt sent as the IsModified trick does not kick in.

 

I think I can sort this by adding an UpdateContext option to the submit button, to change the result of the IsModified data card.

 

This is a bit of a side project for me, so I can;t always work on it for long periods.

 

Rick

Community Support Team
Community Support Team

Re: Approval Loop in Flow

Hi @rickfear

Just an update -- I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

 Within the Condition action, click "Add in advanced mode", type the following formula:

@or(equals(triggerBody()?['Created'], triggerBody()?['Modified']),equals(triggerBody()?['IsModified'], true))

Within the "Update item" action and "Update item 2" action, set the IsModified field to No.

When the user edits a existing record, they must change the IsModified column value to Yes.

Please check if above solution could achieve your needs.

 

Best regards,

Kris

 

 

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

Re: Approval Loop in Flow

Hi,

 

This is a little late but I figure I post my solution.  This can be solved using the Last Modified Date of the File.

 

1. Add a new date/time column LMD

2. When the item is approved / rejected update the LMD to utcNow()

3. When running the flow check if the modified date == LMD.  If so, terminate the flow.

 

t1.jpg

 

t2.jpg

 

t3.jpg

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 203 members 6,470 guests
Please welcome our newest community members: