Trigger Forms Event from the Do Block

I’m wanting to trigger a form event that I’ve defined as an Advanced logic for some form components. I’ve found documentation on how to accomplish this using buttons, but I’m wanting to do this via the Do Block inside the Create Form activity.

Anyone know how to accomplish this?

Note - I’m using the old forms (UiPath.Form.Activites v1.9.3), not the new.

I’m not sure if there is a more elegant coded way, but you could do it by having a variable as an in/out argument to the form, and in the Do block you update the value on the form which triggers your logic.

So specifically, I’m wanting to disable the form’s elements whenever the Do Block code is executing. To accomplish this, I was thinking I would need to trigger an event at the beginning of the code execution to disable the elements and then again at the end to reenable them.

Your suggestion unfortunately only updates the form values based on a variable update at the end of the Do Block code execution, not the beginning. Also not sure how to disable elements using a variable.

This should happen automatically. Don’t you get the red line cycling across the top of the form to indicate the Do Block is executing? For my automations that use forms, the form cannot be interacted with while it’s processing like that.

I get the cycling red line but I’m still able to interact with the form. Here’s a video showing me changing things while the code is running. And it does mess up what the code is doing.

FormInteraction

Maybe try the 2.0.3 version of UiPath.Form.Activities.

It’s what I use. It’s the last release of the “old” version of Forms.

No change for me. Unfortunately, I may just have to accept this limitation. It’s a nice-to-have not a must-have.

Oh I just tried it and you’re right, the form fields can be edited while the Do Block is executing. I never noticed before.

I’ve managed to use the Event setting for a button to get it to disable the fields on the form, but I’m still trying to figure out how to them cause a submit at the same time.

1 Like