Forms activities: pass option values

I need to pass option values to a Form so that the user can choose one of them (from a droplist). The values I get from a database and then store them in a dynamic variable (it doesn’t matter what type, i can adapt) so I can not put them directly into the form as ‘Values’, I need to treat them as if I don’t know what they are.

-I have tried passing an array with data binding but that didn’t work, the field just takes the whole array as the result.
-Also, I have tried with the ‘Custom’ option in Data with the following code:
‘for (var item in arrayministerio) {
values.push(item);
}’
but the Form can’t seem to access my array stored in Uipath.

So, how can i achieve this?

3 Likes

Hi @m_p,

I tried to add array of string via values as data source and found that every time drop down list comes up with double values of whatever the array is :thinking:

S1

Output:

1 Like

Hi, yes i noticed that too (it’s strange but it’s not the principal problem right now, but if you find a way to solve it, please tell me). I wnto to know: what output do you get when you choose one option? Is it what you chose or the entire array? (By output i mean the json string you put in properties)

This is what i get (see key “ministerio”)
output

Hi @m_p,

Entire array:
S2

:frowning: Ok, thanks anyway

1 Like

@m_p

You can pass a List of String or Dictionary to populate the dropdown. You bind the collection to the dropdown control by using [ControlName]_dropdown. The [ControlName] of a dropdown is the Property Name within the Field Key tab. This would be referenced within the FormFieldsCollection property under Data Bindings within the Create Form activity.

Please take a look at the sample code which is built in 19.10.1.

CustomForm_DropdownInput_Example.zip (20.2 KB)

13 Likes

Thank you!! That worked, I had to change a lot of things but it was worth it in the end! :slight_smile:

1 Like

Hi Joseph, thanks a lot, your sample works very well.

1 Like

Dears, Could you please help on my topic in bellow Link? Thanks in advance

@hsendel If you get it in the form of String, we can do String manipulation Activities and get the Data you want

1 Like

This hack was so useful!
I think it should be added to the oficial doc, what do you think @Forum_Staff?

2 Likes

Hi @jmedinacarbonell

Please do not wait with your suggestion. See here on how to provide a documentation feedback :slight_smile:

You can open an article you think should contain this information and add it right away. Our documentation team will either approve it as is or build a new article around it if needed.

Either way, we are open to all the feedback.

2 Likes

Hey there. Hope you are well, could you please tell me what you had to change? I’ve replicated what @joseph.yoon did and mine does not work. Maybe what you did will help mine work

1 Like

Is there any documentation on other field types? I tried to do _radio and _tab for example but it does not seem to work

2 Likes

what if I have pass values to select box(multiple) from excel sheet. Its dynamic either sometime multiple or single

here you are adding values to the dropment. how about selecting from dropdown

@joseph, seems like this doesnt work in UiPath.Form.Activities 1.1.2

Any thoughts. List doesn’t Show at all. Dictionary only shows values not keys

Thanks

1 Like

Hi @loginerror
It is nice that users could contribute to documentation.
However it does not remove the liability from UiPath to provide quality documentation as quality documentation makes quality product.Community can hardly replace professional documentation writers simply because not having the in-depth knowledge of all the nuances of your product. And without quality documentation many features remain hidden which is pity.

Cheers

1 Like

Absolutely. Our team is working on improving it every day :slight_smile:

They love user feedback though, as it helps them prioritise their work.

1 Like