How to use a forms button as an exit trigger in "do while"

I have a form (forms activity) that runs a simple calculation. I placed form and form logic into a do while loop because end users will want to run a serious of calculations before closing the bot/form.

Trying to use a button labeled “exit” as means to close the form/bot when end user is done running calculations but struggling with incorporating this buttons value into my do while condition.

I know it can be as simple as keeping the value of the “exit” button true until it is clicked and it turns to false, but I do not know what that looks like in execution in the forms activity window when editing the button values.

Hi @chris.bartkewicz ,

If you haven’t tried dismissed output property , try that, it should be in create form activity. If user closes the form then dismmmed variable value become true so, you can use in your do while loop.

Or if you have a button to close the form then another property called SelectedButton, you try that as well. Example, if you have exit button that will close your form then when users click on exit button your selectedbutton variable value become “exit” so, you can do if statement to findout if it is exit or not, if it is exit button then you can continue do while

Hope this helps

Thanks for the reply, I love the second recommendation and I feel like I am close.

Struggling to get the button component in the form to possess a value. I guess I just do not know my way around the form.

I have a variable in my process titled exitProcess and it is set to false. How do I get the “exit” button to hold the value true so when it is clicked it can override my exitProcess button to equal true?

Hi @chris.bartkewicz

Hope below screenshots helps you. I have added exit button with action as click. Let me know how you feel about below code stuff


trying to follow your example and wondering where you “selectedButton” variable comes from?

It is coming from create form activity properties

@chris.bartkewicz let me know how this works out?