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

MS Flow (Repeat Previous Step, if Rejected)

Hi, 

 

Hope well. I am new to MS Flow. I've created a flow to help manage a Non-Conformance approvals process (QMS 9001). Logic :

- Step 1, user fills in non conformance via MS Forms, which updates SP List

- Step 2,  moderator reviews new submission, and confirms if it is a valid submission. One approval the user is prompted to fill in a second form, called "Root Cause".  The user enters in a unique reference number to ensure that the 2nd form data goes into the same list item. Flow gets information from new form. 

Problem :  If the Root Cause is rejected, then i would expect the user to re-submit the form, however i dont know how to have flow recall the form data "Do until" i suppose.. but all lost from her. 

 

i have 3 approvals, and need to replicate this all the way through.  Please help.  Return previous step.png

 

 

10 REPLIES 10
Super User
Super User

Re: MS Flow (Repeat Previous Step, if Rejected)

@lennygovender 

It sounds a sthough you want to create a State Machine Flow.

Herer are a couple of refernces to get you started:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Simulate-state-machines-with-Micro...

https://www.youtube.com/watch?v=e8Nuswofodw

https://sergeluca.wordpress.com/2018/11/26/new-flow-state-machine-pattern-with-unlimited-running-tim...

 

 

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: MS Flow (Repeat Previous Step, if Rejected)

Hi @lennygovender ,

 

Do you want to repeat the process until the request is Approved?

 

By the way, I assume that link of the form will be added in the email body, so an email with the link will be sent repeatedly until the request is Approved.

 

I have set up the flow likes below for your reference.

 

After the trigger, initialize a String variable, named as Response.

 

Add the first approval action.

 

If it is approved, under If yes branch, add a Do until loop.

 

The Do until condition will be set as:

@equals(variables('Response'), 'Approve')

 

Within the loop, add Send an email to send out an email with the form link.

 

Then add the trigger When a new response is submitted.

 

Get response details from the form.

 

Then start the second approval action.

 

Add action Set variable, select dynamic Response from the approval action for the Value field.

 

The process will be repeated until the approver approved the request.

1.PNG2.PNG3.PNG

 

Best regards,

Mabel

 

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

Re: MS Flow (Repeat Previous Step, if Rejected)

Thank you Scott, appreciate your very quick response. i am so eager to start reading these articles and will revert with progress updates.


@ScottShearer wrote:

@lennygovender 

It sounds a sthough you want to create a State Machine Flow.

Herer are a couple of refernces to get you started:

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Simulate-state-machines-with-Micro...

https://www.youtube.com/watch?v=e8Nuswofodw

https://sergeluca.wordpress.com/2018/11/26/new-flow-state-machine-pattern-with-unlimited-running-tim...

 

 


 

lennygovender
Level: Powered On

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi Mabel, 

 

Thank you for getting back to me, appreciated. I tried the do until, but didnt initilaize a string or may have put the do until in the wrong place.  So will definitely do this and revert. 

 

I wish i could send you the entire flow, (will try) it has link 11 steps and works for the most part. See i use the form to capture "a reason for the non-conformance", the moderator will need to approve the outputs of that form, and is "Not Approved" - the user needs to resubmit the form..  and the next action will only take into affect, if that approval is satisfied.. 

 

Later in the flow, there is yet another approval process where a senior manager needs to verify the same.  Going try your recommendation and will revert.  Thanks a mil

 

Community Support Team
Community Support Team

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi @lennygovender ,

 

Does it work for you?

 

Please post back if you need more help.

 

Best regards,

Mabel          

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

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi Mabel, 

 

I made the recommended changes, however it didnt work unfortunately. i think there is a problem with how i nested by conditions "If Yes / No". 

 

I did a work around -  created a seperate flow to capture the second form.. thats seems to work but learning how to tie the record back to the original list. i a working on an append variable. 

 

i am doing a ton of research on "State Machines" as well. 

Community Support Team
Community Support Team

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi @lennygovender ,

 

You may share a screen shot on your current flow.

 

Best regards,

Mabel          

 

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

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi, Thank you Mabel. I am so confused, i get different errors each time, and on one occasion - it actually worked and updated the correct list item on Sharepoint, but the flow still failed.  i have attached a few screen shots.. 

 

1) Fails when trying to match the Reference, 

2) Says append to array is incorrect. 

 

Trigger RCA_Flow_1.pngTrigger RCA_Flow_2.pngTrigger RCA_Flow_Error 1.pngTrigger RCA_Flow_Error 2.png

Community Support Team
Community Support Team

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi @lennygovender ,

 

Thanks for updating with more details.

 

First, please add the condition under Apply to each 8 but not within the apply to each 8 under Append to array variable.

 

Second, to update the corresponding list item, you may need another condition to find out the specific one. Let’s say that there is a common value between the form and the list, then you could use the common value in the condition.

 

Besides, about the error message on Append to array variable, please make sure each reference column contains value.

 

About error message on Get items, how is it configured? Please make sure the column does exist in the list.

 

I have made the following flow for your reference.

1.PNG2.PNG

 

Best regards,

Mabel  

 

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

Re: MS Flow (Repeat Previous Step, if Rejected)

Hi, I made the changes - this helped tremendously. i added a filter array to help match the 'unique' reference to update the list.. and it worked.. i was going to write a help guide to assist others with the problem i had. 

 

it worked for 1 hour.. and then it stopped. The Flow remains in a "running" state and does nothing. There are no errors at all, it just doest want to work. The last one i executed on Friday was still running this morning. 

 

i checked my plan and its on a 90 day trial (active) for the premium flow, still no joy.  I make progress and then it just stops again.. 😞 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Kudoed Authors
Users online (5,305)