How to get values from Uipath.Form?

This should be simple, but I can’t figure it out.

I have a form from the form.activity package. The form is simple with a text input field and a submit button.

  1. I open the form using Show Form
  2. I listen to events by using Run Local Triggers

Now I just want to get the result of the user input. I have some variables waiting in my Main scope for the values to be added. It should work similar to arguments in a workflow no? Shouldn’t I be able to map the Dictionary of the Show Form to my waiting variables?

  1. I tried simply mapping the Dictionary in the Show Form activity in my main workflow. But that didn’t work.
  2. I tried putting using the default Submit button on the form, but the values are not added automatically. In fact, the form seems to close before anything happens.
  3. I tried adding a button with a simple Event trigger, then using Get Form Values in that trigger. But there is no way to link the values to my main scope variables there.
  4. I tried passing in my variables in the Show Form activity In/Out, thinking that they needed to be there to load up. But that didn’t work either.

This is so complicated! Why don’t forms work like workflows with arguments in and out?
Where the inputs are mapped to local variables when the form closes?

Regardless, can someone explain to me how to get values from a form?

Hi @Terry_Marr , if your requirements are simple, then the UiPath form works ok. Otherwise, you’ll be wasting a lot of time trying to get it to work the way you want, with varying levels of success. Hand-coding an html form and wiring it up with events will be the most time efficient way.

Change the “Submit” button action to an “event” and then in the trigger workflow, use “Get Form Values”, followed by “Close Form”.

May be simpler to just use “Custom Input” or “Input Dialog”?

@Terry_Marr

Try creating global variables and assign the get form values to global varibles

Cheers

OK that worked. Are you saying that the ONLY way to get values out of the Forms activity is to first make a bunch of global variables to set the returning values to? Is there a way to assign the whole dictionary object at once and pass that?

1 Like

@Terry_Marr , there’s no option to pass values around as arguments in form based trigger flows. You get form values, assign them to some sort of global variable collection - dictionary, datatable etc. I usually use global datatables.

1 Like

@Terry_Marr

Glad it helped first

Get form values also would work

What you need to do is to use a button without closing the form and then after getting values use close form activity

Cheers

1 Like