How to use forms to re use

Hello Everyone,

I m using forms activity i used that for date select option if the i choose wrong date then it go back and re open the show form again.

Note at first run show form. Is working

Thanks

Hi @suraj_gaikwad

As per my understanding, you can use a do while loop & place the show form activity inside loop, then check if the selected date is valid. if the date is wrong, the loop runs again and the form opens for re-selection. the loop stops only when the correct date is chosen.

Happy Automation

Hi @prashant1603765

Tried this but the same issue occurred.

Thanks

@suraj_gaikwad

Instead of show form try using create form again ..looks like the form instance is ended

Cheers

What you should do is a trigger for when the date is selected, do the validation, and if the date is OK then close the form. If it is not OK then prompt the user that the date is invalid and leave the form open for them to correct it.

Hello @Anil_G
@postwick

I tried with new show forms instance but it’s showing same error. Once the option select then showing message box.
To be continued with these date if they don’t want yo continue then after some delay show forms again.

Thanks

@suraj_gaikwad

Can you show your workflow please

Cheers

What version of UiPath Form Activities are you using? You shouldn’t be closing the form when they set the date, you should have a trigger on the date field and in that trigger you validate the date. If the date is ok THEN close the form.

Hi @Anil_G & @postwick

Activity - 24.10.0

First date selection option

After date selection

If the above date don’t want then

First image should be come to date selection

But it’s showing error

Thank you

@suraj_gaikwad

Can you try giving an instance name for it please in both show forms

Also are you using a close form after the first show form?

Cheers

![IMG20250607170213|375x500]

I used close form it won’t work

(upload://d4uX74tTphcoUavmI8pD6KpDtCy.jpeg)

@Anil_G

Thanks

@suraj_gaikwad

Please upload the sequence properly

cheers

Are you trying to use REFramework for an attended automation using UiPath Forms? There’s your problem. REFramework does not at all accommodate how UiPath Forms work. This posts may help you understand how to work with Forms, Triggers, etc.

https://forum.uipath.com/t/how-to-create-a-select-file-or-select-folder-element-in-new-uipath-forms/

@Anil_G i can’t share the sequence

@postwick I’ll try this

Thanks

What you need to have is Main.xaml that shows the form, then for each action taken on the form (ie change field, click button etc) a trigger (which is a separate XAML) that does something based on that form action the user did. Here is what a UiPath Forms automation looks like.

Main.xaml:

That’s it. That’s the entire Main.xaml. It shows the initial form and then runs local triggers.

Here is an example of one of the triggers, Set All Notes:


Here is an example of one of the triggers that processes data entered into the form and then closes the form then shows a new form:



Here is what the one of the forms looks like:

Here is how the Select File button is configured with a trigger:

The key here is the Action being event instead of submit. This makes it so the form does not automatically close when the button is clicked. It just initiates the trigger associated with the button:

The easiest way to create a trigger on a button or field is to click the lightning bolt icon:
image

An important thing to understand is that “run local triggers” basically pauses Main.xaml at that activity, waiting for actions on the form that run the triggers. When an action (ie button click, field change, etc) that has a trigger associated with it happens, the trigger XAML runs, and then it goes back to just waiting for another trigger. At this point Main.xaml is continually paused at “run local triggers” until a “stop local triggers” activity is encountered. Once a “stop local triggers” is encountered then Main.xaml continues past the “run local triggers” activity.

So then in order to set up “start over from the beginning” logic - ie the user has completed all steps and we need to show the initial form again
I have a trigger on the “submit for upload button” and that trigger looks like this:



then all the steps that process the data from the form, create a queue item, do some logging, then prompt the user with a Yes/No asking if they want to submit another item:
Either way, I close the form that’s currently showing:

After that is an If where I either show the initial form again, or if they clicked No I use Stop Local Triggers which makes Main.xaml continue from the “run local triggers” and since I don’t have any activities after that, the automation just completes. You could, of course, have additional steps after the “run local triggers” in Main.xaml but keep in mind they won’t execute until the automation encounters a “stop local triggers” activity which basically un-pauses it and lets Main.xaml continue.

1 Like

Hi @postwick

I’ll try this

Thanks you