Skip to main content
Nintex Community Menu Bar
Solved

Can't stop a loop


Forum|alt.badge.img+10

Hello,

 

I unable to stop a loop… I have a notification that goes out if changes are needed to a form. When the person to make these changes makes the change, they have to tick a toggle (YES, like below) 

this confirms they made the change but if the toggle continues to be unticked (NO, like below) the loop runs and sends out another notification until its ticked (YES).

 

I have it set to run every 15 mins for testing purposes. I went into the form and selected YES or ticked the toggle and the loop continues to run and send me a notification every 15 mins. 

How can it check if the toggle is ticked  so that it doesn’t continue to loop and send out emails? How do I get it to proceed to the next action (reset toggle/clear outcome) as shown below?

 

 

Best answer by Sampcyn

@jpacheco 

Have a look at my setup again. I believe it should work for what you are looking to do here. I updated the control and action names to make things much easier to follow.

You need a nested loop (branch by condition + start a loop) and a “dynamic” variable i.e. “var_CorrectionMadeValue”. The latter keeps track of the “Correction Made“ boolean flag value - this will allow for continuing or ending the email reminder loop sequence.

First, query the SPO list item and store the current “Correction Made” value in the WF variable - “var_CorrectionMadeValue”: 

 

This then goes into a “Branch by Condition”  logic that checks if “Correction Made” is  a “Yes” or “No”.

If YES, we don't go in the email reminder loop and the workflow continues to the next logical step/end the workflow. Although not required I’m setting the value for “var_CorrectionMadeValue” variable to YES.

 

 

If NO, we go into the Email Reminder loop that will keep running until the value for “var_CorrectionMadeValue” changes to a YES. And, each time we go through the loop we also query the SPO list item to get the current value of the “Correction Made” flag and then store it value back into the “var_CorrectionMadeValue” variable that is being evaluated by the loop condition. If or when the value returns as a “YES” is when the loop is exited and the workflow continues to the next logical step/end the workflow:

 

Here is the updated WF key for reference: NK6X7rp3MiebXSwUS79BeDWLBa1hWTeHxHhgRt7KFbFBsBLBL

 

Hope this helps. Let me know how it goes.

 

View original
Translate
Did this topic help you find an answer to your question?

9 replies

  • Nintex Employee
  • 9 replies
  • March 5, 2025

Hi ​@jpacheco 

You can put your loop inside of a “Run If True” action and ONLY run if the “Were corrections made” is No.

 

HTH

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • March 5, 2025

@Sampcyn ,

Thanks for your quick response!

Ok, so I applied your suggestion but it seems to run to the next action immediately and sends the “assign a task” action out right after the 1st notification goes out to “make changes”. It doesn’t pause the workflow if the toggle remains unticked… am I missing something?

I need the loop to continue running and sending email reminders if the Toggle button continues to remain at NO/Unticked… but if by chance the next day the user would make the change to the form and they would tick the toggle button, then the workflow would proceed to next action to “reset toggle/clear outcome.

 

I have the “Start a loop” configured as...below.

Could this be throwing it off?

 

 

Translate

  • Nintex Employee
  • 9 replies
  • March 5, 2025

@jpacheco 

 

Here’s my setup based on your scenario, and WF export key for refence: QxA53HddQ1KC7GnYc9Swm9qFJ411vWQkh22Z55ki3oKEcftaE

 Essentially, a loop inside of a loop and a set variable to keep the loop going or end it.

This would would better if you had a form(task form) inside of the secondary loop to toggle the option for correction needed or not but I think this logic should work for your scenario nonetheless. You might need to massage things a bit.

Let me know what you find out.

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • March 6, 2025

@Sampcyn ,

 

So it doesn’t seem to be working as I need. I referred to your setup but of course made changes on my end as I needed. Still no luck.

So the way I have this setup is when a form (O365  responsive forms) is submitted in SharePoint it goes to different approvers but when an approver requests a change, the user has to go back into the form and “tick a toggle” button stating they made their changes. The workflow (NAC) needs to then detect if the user has “ticked the toggle” button, but I don’t think it is… See, the toggle is set to “No” by default and currently it runs right through the actions in the WF and seems like its not pausing as I need. Below is my current setup…

In the center, I have what happens when the changes are requested. Since the email goes out once, the submitter receives it but tends to forget if not responded to immediately. I’m trying to put in a loop so an ongoing email can continue to be sent until the toggle in the form is ticked.

I don’t think the toggle is being detected as “ticked”.

 

 

 

Thanks!!

 

 

Translate

  • Nintex Employee
  • 9 replies
  • Answer
  • March 6, 2025

@jpacheco 

Have a look at my setup again. I believe it should work for what you are looking to do here. I updated the control and action names to make things much easier to follow.

You need a nested loop (branch by condition + start a loop) and a “dynamic” variable i.e. “var_CorrectionMadeValue”. The latter keeps track of the “Correction Made“ boolean flag value - this will allow for continuing or ending the email reminder loop sequence.

First, query the SPO list item and store the current “Correction Made” value in the WF variable - “var_CorrectionMadeValue”: 

 

This then goes into a “Branch by Condition”  logic that checks if “Correction Made” is  a “Yes” or “No”.

If YES, we don't go in the email reminder loop and the workflow continues to the next logical step/end the workflow. Although not required I’m setting the value for “var_CorrectionMadeValue” variable to YES.

 

 

If NO, we go into the Email Reminder loop that will keep running until the value for “var_CorrectionMadeValue” changes to a YES. And, each time we go through the loop we also query the SPO list item to get the current value of the “Correction Made” flag and then store it value back into the “var_CorrectionMadeValue” variable that is being evaluated by the loop condition. If or when the value returns as a “YES” is when the loop is exited and the workflow continues to the next logical step/end the workflow:

 

Here is the updated WF key for reference: NK6X7rp3MiebXSwUS79BeDWLBa1hWTeHxHhgRt7KFbFBsBLBL

 

Hope this helps. Let me know how it goes.

 

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • March 6, 2025

@Sampcyn ,

 

Thanks for your quick response once again! So I tried using the new key you shared but it doesn't work…

 

 

 

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • March 6, 2025

@Sampcyn ,

Please disregard! I got it to work! Not sure what happened!

I’ll let you know how it goes!

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 82 replies
  • March 7, 2025

@Sampcyn ,

Ok, first of all….

I owe you a virtual coffee!!!

So here you go!  ☕ 🍩

You’re amazing and hanks so much for your effort in explaining this to me, I greatly appreciate your help! I’m still learning... but you’ve been amazing and keep on doing an incredible job helping others! Thanks again. 😁👍🏽
 

Translate

  • Nintex Employee
  • 9 replies
  • March 7, 2025

You are welcome ​@jpacheco . Glad I was able to help.

Thanks for the virtual coffee, much appreciated 😎

 

Good luck with your Nintex journey. Remember the community is here to help you along the way.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings