1459
Views
4
Comments
Solved
How can I have a List with Checkboxes?
Question

Hi there.

First off, I think I'm gonna explain what I'm trying to achieve.

I am trying to have a list where each ListItem has a Checkbox. This list is being populated by an Entity. The user can check as many items of the list as they want to, and when they're finished, they click on a "Done" button on the screen, and all of the items they selected are saved in a Database table.


My problem(s):

  1. When a user selects one of the ListItems, all of the others ones are also selected.
  2. I don't know how to keep track of which items were selected, so when the button is clicked I can save each of them into the database.


I would really appreciate if someone could help me out with this :)

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Yizuhi,

Add an extra calculated attribute in the aggregate that populates the list item.

  1. In the aggregate, click New Attribute to add a new attribute to the aggregate and name it for example Selected.
  2. Open the attribute menu and select Edit formula...
  3. Define the expression as False, this will default the data type to boolean

Now in your listitem, bind the checkbox widget to the Selected attribute from the aggregate.

After the user made a selection and pressed the button, on the button logic you can use ListFilter action to filter all selected items from the List.

Regards,

Daniel

UserImage.jpg
Yizuhi Galaviz

Daniël Kuhlmann wrote:

Hi Yizuhi,

Add an extra calculated attribute in the aggregate that populates the list item.

  1. In the aggregate, click New Attribute to add a new attribute to the aggregate and name it for example Selected.
  2. Open the attribute menu and select Edit formula...
  3. Define the expression as False, this will default the data type to boolean

Now in your listitem, bind the checkbox widget to the Selected attribute from the aggregate.

After the user made a selection and pressed the button, on the button logic you can use ListFilter action to filter all selected items from the List.

Regards,

Daniel

 

 Thanks a bunch, this worked perfectly.

2022-10-16 15-30-09
Miguel Chaparra

Hi Yizuhi,


You can add a new attribute of type boolean to your aggregate and use this attribute in your checkbox. That way each row will have an attribute like isSelected for your checkbox. After user submits you can use a listFilter to get the selected ones.

Click new attribute and then set its value to false.


Hope it helps!


Regards,

Miguel Chaparra

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Yizuhi,

Add an extra calculated attribute in the aggregate that populates the list item.

  1. In the aggregate, click New Attribute to add a new attribute to the aggregate and name it for example Selected.
  2. Open the attribute menu and select Edit formula...
  3. Define the expression as False, this will default the data type to boolean

Now in your listitem, bind the checkbox widget to the Selected attribute from the aggregate.

After the user made a selection and pressed the button, on the button logic you can use ListFilter action to filter all selected items from the List.

Regards,

Daniel

UserImage.jpg
Yizuhi Galaviz

Daniël Kuhlmann wrote:

Hi Yizuhi,

Add an extra calculated attribute in the aggregate that populates the list item.

  1. In the aggregate, click New Attribute to add a new attribute to the aggregate and name it for example Selected.
  2. Open the attribute menu and select Edit formula...
  3. Define the expression as False, this will default the data type to boolean

Now in your listitem, bind the checkbox widget to the Selected attribute from the aggregate.

After the user made a selection and pressed the button, on the button logic you can use ListFilter action to filter all selected items from the List.

Regards,

Daniel

 

 Thanks a bunch, this worked perfectly.

UserImage.jpg
Akshata Patil

Hi, I have a doubt, does this work same- when we use pagination for the aggregate?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.