CreateForm Activity

I’m just toying with this activity. Having no problem getting data out of it or designing the form. However I’ve noticed that the activity requires an embedded sequence (into which you don’t have to enter anything if you don’t want to). However, if you do (even something as simple as an “assign”) the activity seems stuck in a loop … it will not proceed past the activity when you press “Submit” and the form stays visible. What condition will cause it to exit it’s loop? I see no attribute that allows the Submit button to actually dismiss the form.

I certainly can just leave the sequence empty and it achieves what I want but it’s a little non-intuitive. If you, say, wanted the loop to exit after a particular number of entries, that’s fine - but what conditions tell it to break out of its loop?

Thanks,

-Max

Hi @MaxPeck,
Using Forms you can grab data from outside of it as well as push data out. I will show you my example of how I’m working with this:

  • Here is how I’m passing variables to my form

  • Then in form designer a can assign my variable to particular element (text box in this case)
    image

  • Finally I can use output for pressed button and assign it to variable (of String type)

It returns the string which is set in particular button here:
image

Hopefully this will help you :slight_smile:

Hey @Pablito,

Thanks for the information, good stuff! (will file away for reference) but I’m not having any trouble getting data in and out of the form. The problem (I’m using 2019.10) is that the CreateForm activity seems to require an embedded sequence (UiPath throws an error if you don’t include one).

image

If the sequence has any activities in it, pressing the submit button (well, any button actually) causes execution of the steps in the sequence then loops right back to the form. I can see why you might want that to happen if you’re entering a lot of data with the same form, then processing it.

The trouble is that there doesn’t seem to be any way to exit the loop. The embedded sequence keeps getting executed in an infinite loop. What I need to know is how do you exit the loop?

Thanks,

Max

Sorry for missunderstanding. I will test it as I see first time problem like this. Are you able to attach example where you have this issue (I mean the project)?

Meanwhile please try to downgrade Form package to version 1.0.0 where Create Form looks like this:
image

Hey Pablito,

I like the fact that you guys are providing a little more desktop interaction with UiPath. UiPath is turning out to be a general-purpose programming environment
as well as RPA.

Yeah, you’re right; I am using 1.10 of the forms package here which is “preview”. Consider me, then, a beta tester!
:wink:

Here’s a description of the problem with
Create Form. A simple project is attached.

One problem is that the activity requires that there be a sequence inside it. When you pull the code for that activity it creates the instance with a sequence
inside.

image001.jpg

If you delete the sequence and try to run the project you get the error below. The base
Create Form class shouldn’t gripe at a null pointer here unless it requires some kind of functionality from the embedded sequence. If it
does require the component then the IDE should pop an error when you try to remove it, not throw an exception at runtime. That aside, using it with just a blank sequence in it is OK.

image003.jpg

However, if you decide to populate the embedded sequence with
any activity, the thing gets stuck in a loop. You can’t leave the form except to cancel it. When you do that, you get this error:

image004.jpg

Exiting the form this way does exit the sequence but, of course, nothing in the form get’s presented to the running code.

I can see a reason for being in a loop … you might have an application that presents the form repeatedly to input multiple like values and add them to a database
or something. That’s fine. However, without some ability to exit the loop gracefully it’s not very useful, or at least confusing. My suggestion would be to add a property to the button class in your forms that will cause termination of the loop. Then someone
could add an ‘Exit’ or ‘Done’ button to the form with the appropriate property checked. Upon pressing said button the form will silently exit the loop and continue the workflow.

Forms Tinkering.zip (21 KB)

Sorry for late response. I tested your workflow. Everything is as it should. You haven’t told me that you are using Flowchart for this instead of workflow. This changes a lot of way how Forms are working. If it would be placed in workflow then no action assigned for button = close application/go to next step. For flowchart you need to predict what needs to happen.

See how I solved this for your project:
FormTest.zip (23.6 KB)

  • When you will dismiss the form it will catch dismiss button as true and will go to “wall” means it will close
  • If you will provide some data and click test it will catch that dismiss button is false and selected_button = test which means it will show you data confirmation and will go back to application
  • If you will provide data and click submit it will catch that dismiss button is false and selected_button = submit which means it will show you data confirmation and will close app after this

The thing about infinite loop is definitely a bug. I will have a chat with team responsible for Forms and will point it out. It shouldn’t be like this. Anyway I have no problem with running process without anything in the sequence under form.

Thanks. BTW, rather than regress to an earlier version I noticed that a newer version was available so I tried it. It looks like the “loop” bug was addressed
there.

Thanks for looking into this.

1 Like