New form activity with dynamic checkboxes

I am using Studio 2023.10 with package UiPath.Form.Activities = 23.10.4

On a form, I want checkboxes which are generated in runtime, depending on a list of items.
The item names and the number of items are depending of a list of items, which is filled in previous code. The number of items will never be more than 16.
Example:
image

When the user pushes the button Submit, then I want to have back the list of the checked items.

I have done this in a previous (old) version of form activities (package 2.2), but in the new version I don’t find the right way to do this.

Thanks for advice.
Johan

@TALLIEU_Johan

Please check this…I have explained the same in steps…explained for dropdown can use same for check box

Hope this helps

Cheers

Hi, I see that this can work for a drop down list, but I don’t know yet how to put the needed checkboxes on the form this way.

KR
Johan

Hello @TALLIEU_Johan

Sequence
Variables
items (List) - Initialize with your list of items
selectedItems (List) - Initialize an empty list to store selected items

Assign activity
    yourForm = Create Form

For Each activity
    item In items
        Add Form Element
            Type: Checkbox
            Label: item

Add Form Element
    Type: Button
    Label: Submit
    On Click
        Assign activity
            selectedItems = GetSelectedItems(yourForm)

Log Message
    Text: "Selected Items: " + String.Join(", ", selectedItems)

Function GetSelectedItems
Arguments
form (Form) - Input form
Variables
result (List) - Initialize an empty list to store selected items

For Each activity
    checkbox In form.GridContainer.Children
        If checkbox is Checked
            Add item to result list

Thanks & Cheers!!!

I think it is not possible yet to do that in the new forms (studio 2023.10 with form activities 23.10.5). I have raised a ticket to UiPath support.
KR
Johan

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