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

Trouble with an Approval Flow

Good Afternoon.  I am having trouble with an approval flow.  Here is the gist of what I am trying to do:

 

User fills out a sharepoint form (add new item to list) with an attachment.  When the new item is created, the attachment is copied to a sharepoint documents folder  (access limited to approvers).  This portion works.

 

Next, the flow has a 1 minute delay -- allowing time for the attachment copy to be executed.  Then the flow does a "When a file is created or modified (properties only) action to start and wait for an approval.  The approval email goes out, has a link to the document in the document library, and the recipient can review, the file, make changes, save it, etc.  This also works.

 

Next, the approver returns to the approval email and decides whether to approve or reject.  Upon approval, the file is moved into a different sharepoint document folder that is accessible to anyone who uses the site.  This move also works just fine. 

 

When an item is approved, there is also an update item action to go back and update the original sharepoint list to set the Date of Approval and move the status to approved.  This does not work.

 

On the approval response of reject, there is an update item for the original sharepoint list to update the Status to rejected.   This also does not work. 

 

I am stumped as to why.  Below are some screen grabs of the flow.  Any insight would be much appreciated.

Appr1.PNGAppr2.PNGAppr3.PNG

 

 

 

 

5 REPLIES 5
Super User
Super User

Re: Trouble with an Approval Flow

@MattH2 

Your issue is that in your condition you are looking at Responses and going into a loop.

You need to check the Outcome for Approve or Reject - Not Responses.  That will also eliminate the need for the loop.

Let me know if you need more help.

 

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

Scott
Community Support Team
Community Support Team

Re: Trouble with an Approval Flow

 

Hi @MattH2 ,

 

As suggested by @ScottShearer  , if you want to get approval results, please use outcome.

Please check this similar thread and see if it helps:

https://powerusers.microsoft.com/t5/Building-Flows/Response-Dynamic-Content-for-Approvals-does-not-a...

 

Best Regards,

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

Re: Trouble with an Approval Flow

Thanks @ScottShearer. That definitely simplified the flow and removed a couple of loops.  Unfortunately, I am still having an issue where the "Update Item" is not working for either approve or reject and FLOW is forcing me to put the "Start and Wait for Approval" into an Apply to each.  I suspect that my issue is tied to the "Update Items" looking to update the original Sharepoint list while the "Value" that I am looping on is from "When a file is created or modified".  As an experiment, I tried testing the flow with "Body" instead of "value" for the Apply to each that is wrapped around my Approval. 

 

My move file executes correctly, but neither update item (approve or reject) ever executes and the Test Flow just continues to run.  Appreciate the help.

Appr4.PNG

 

 

 

 

Super User
Super User

Re: Trouble with an Approval Flow

@MattH2 

I believe that you'll have success if you eliminate the Apply to each 2 loop and place your approval directly below the trigger.  See my screen shot below.

BasicApproval.jpg

 

Also, while there is nothing technically wrong, it is unusual to have a second trigger inside of a Flow.  You may want to consider moving the trigger and approval actions to a separate Flow.

 

 

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

Scott
MattH2
Level: Powered On

Re: Trouble with an Approval Flow

@ScottShearer 

 

I think I am going to have to split into 2 flows.  FLOW is forcing an "Apply to Each" whenever I select an item from the dynamic content for "When an item is created or modified".  I want to include a link in the  Approval email for the approver to open and edit the document.  I cannot figure out how to avoid that.

 

I actually considered the 2 flow approach initially, but had 2 concerns.

 

1) How do I avoid creating a flow loop I cannot escape?  I.E.  File is created > Flow starts >  Approval Email sent with link to edit file > File is edited and saved >  Flow starts on file modified.  I am really struggling with the logic on this one.   

2) How do I go back and update the correct record in the original sharepoint list?  The only information I  have would be the Attachment that got saved to a directory - which could, technically, be changed.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,449)