UiPath Forms 23.x selected button

We build forms in previous versions and had buttons like “Run\Cancel\Settings” etc

now we can’t publish unless we update to new version of forms, or lower system activities

Very simple question
if in form I have “Submit” and “Cancel” buttons

how can I tell which button user clicked on?

@ZoranK

you can use form event triggers

image

cheers

I have started learning the new forms and finally have my head around it. Previously you just put a bunch of IFs in the body to execute based on which button was clicked. Now you have to use triggers.

Here is my main.xaml:

I have two buttons on the form (which is in a file named Setup.uiform)

image

Then you create a separate XAML for each button (ie trigger).

image

Cancel is fairly simple, here’s the Trigger Cancel Setup.xaml:

The Trigger Complete Setup.xaml:

You can see how after the Get Form Values I have a Get File Info which is the beginning of what it needs to do when Complete is clicked, the rest of the process is after that.

By the way, when you get stuck and it won’t let you edit the Arguments (dictionary) for one of these activities, change the value that’s in “Instance Name” and it’ll open back up.

I didn’t use Instance Name in my automation because I have just one form that opens once, so the form name is enough. However, if your automation opens the same form more than once, then you would use Instance Name to differentiate between the two.

This video helped me a lot.