How to use select boxes?

Hi,

I am trying to create a form with multiple checkboxes. Each box has a value the same as the name in below picture.

How do I bind the selected output from the user? What are the output? Dictionary, array? I’m not that strong in either of these things.

image

Ideally I need an array or list I can use in a for each as the underlying process needs to be done in the selected companies by the user.

Thanks a lot for your help!

/stch

2 Likes

Hi @stch
Arr_Company give it as string array={“SYS”,“SYD”,“BCI”,“BCS”,“BCN”,“HSV”,“HBI”}
for each item in Arr_Comp

Use Click activity where in the selector pass the aaname as item

Thanks
Ashwin S

1 Like

Hi @AshwinS2

Thanks for your reply, but the form is a form I have made using the Forms activity in UiPath. I would like to get the output of what the user checks in an array, so I can use it in a for each. I need to bind the FormFieldsCollection.

Hi @stch

Try to read this article hope this might be helpful to you.

cheers :smiley:

Happy learning :smiley:

1 Like

Hi @pattyricarte

My question is regading the Forms activity. Maybe I misunderstand you, but I don’t see how I can use Get Attribute in this scenario.

Thanks.

Hi @stch

Use Get Attribute and set the property as checked and ensure you set a condition as
and another thing use it in then condition as get attribute and set the property as aaname

and then use write range activity to add the check box values

Thanks
Ashwin S

Hi @AshwinS2

I cannot do this as the checkboxes are made in the Form Designer using the Create Form activity.

My question is how to get the output of each checkbox that the user selects in the Form using the select boxes field.

I think I read somewhere that the FormFieldsCollection has a output as dictionary, but not sure how it works exactly. I would like to end up with a list of the name of all true checkboxes that the user selects in the process.

Thanks.

Hi @stch

Check this

Thanks
Ashwin S

Hello Steffan,

Please use the FormFieldsOutputData property from the Create Form activity to retrieve the output of the supplied values to the Forms activity. The output value will be of string datatype that will be in a JSON format.

Sample output:
image

In your use case, we need to extract the company names that are selected during the execution. I have chosen SYD and BCS during the runtime and because of which the values of the selected checkboxes are returned as True in the above sample output.
image

You need to Parse the JSON content and fetch the values that are True. Attaching a sample xaml for your reference. PLMK if you have any clarifications.
FormActivities-MultipleCheckboxes.xaml (18.5 KB)

Thanks and Regards,
Dominic

3 Likes

This works! Thanks a lot @Dominic. :slight_smile:

how to input multiple select box

1 Like

I know this is an old thread, but it’s near the top of Google for uipath form select boxes variable type right now. I was trying to figure out what variable type to bind Select Boxes to. @Dominic 's answer is good, but I didn’t want to parse JSON, I wanted to bind directly to a variable like with my other form fields.

I found that you can also use FormFieldsCollection. The variable needs to be Out of type Dictionary<String, Boolean>:

image

The dictionary’s keys will be the values you set in the form designer. Say these are your labels and values:

image

Your dictionary’s keys will be apples, oranges, bananas. Its values will be True where checked and False where unchecked.

So, let’s say you bind to a variable named fruits. You can index into fruits to see whether the user checked Apples.

fruits("apples")

The above evaluates to False if the user didn’t check Apples and True if they did.

Hope this helps someone…

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.