Add Cancel button to "Input Dialog"

Hi all.

The user need to be able to cancel the process instead of entering a value and continue it.

Regards,
Marco

Hi @MarcoM,
User can just click “X” to cancel:
image

Thanks Pablito.

But as “intercept” the X click?
Because if I click X, the process it continues.

Regards.
Marco

You can use Custom Input activity and define your own action based on java script.
Example here:

Hi @MarcoM,

In place of input dialog box use message box

Hi varunk.
This is not the best way.

I have this input dialog.
In this moment I need 2 options:

  1. Insert the code and click ok
  2. Cancel the procedure and stop workflow

Dialog1

@MarcoM

In that case, why don’t you identify those option with it’s code value like, “Enter VIP Access code or Robot will be stopped if it is blank.”

J,

1 Like

Hi @MarcoM,

For that input dialog box properties
see name as options,there you can pass how many you want like as you said you want two
Ex - {“OK”,“Cancel”}
Pass like this it will appear

Hi,
I’m reviving this old post.
If you use {“OK”,“Cancel”} in properties “Options” than you are loosing the text input field.
You can use Form Designer to create multiple Buttons. https://docs.uipath.com/activities/docs/form-activity.

To further clarify the topic of this thread, I’ll compare the Message Box and Input Dialog Box activities to explain more thoroughly what the problem is.

The Message Box activity, as you see on the left in the screenshot below, has an Input option for its Buttons. These options include “Ok”, “OkCancel”, “YesNoCancel”, and “YesNo”. When using this activity, you can establish from the very beginning what Buttons that activity will have. You can store the value of the selected Button in a variable for later use if you wish, as indicated by the ‘ChosenButton’ Output field at the bottom of the list in the Properties window. I have used this functionality multiple times with this activity for some of my processes and it has been very useful.

Next, the Input Dialog Box activity, as you see on the right in the screenshot below, does not have an option for Buttons within its Input section. Additionally, it does not contain an Output to store the variable of the selected Button like the Message Box activity does.

Therefore, as @MarcoM pointed out earlier in this thread, if you select the ‘Cancel’ button (the ‘X’ in the top right-hand corner of the Input Dialog Box pop-up while your process running) the process will continue to the next activity. That should not be happening, which is the problem. In this particular use-case, the whole point of the ‘Cancel’ button is to terminate the activity and stop the overall process that is currently running without proceeding any further.

Not having the same Button options as the Message Box activity is the underlying issue here because we don’t have the ability to establish an alternative behavior we want to get out of the Input Dialog Box activity. Between these two activities in the most recent version of UiPath Studio, if we want to stop or abandon a process after it has been launched, we can do so with a Message Box. We cannot, however, with an Input Dialog Box.

That has been frustrating to deal with. I’ve been trying to find a workaround for this issue over the last couple months and nothing I have tried is working, at least for my particular needs. At one time, I thought I was using this activity incorrectly, but when I started looking deeper, I recognized this functional limitation.

My question: How is it that the Message Box activity was created with an option for Buttons and a corresponding Output, but the Input Dialog Box activity was not? They are both simply a form of a pop-up box; they function almost exactly the same way. Why was this functionality left out of the Input Dialog Box activity? That’s what I’d like to find out.

Does the UiPath community have a resource for suggesting or submitting requests for features or enhancements to the UiPath platform? I’m a bit surprised, given this thread was started over a year ago, that more hasn’t been done to address this. I think this is a much needed update.

1 Like