One checkbox per row in a List

  

Hello,

I have gotten a lot of help from this forum lately, you are a great source of inspiration and knowledge, thank you!

To my latest problem: In my application I am consuming a REST API and creating entities, I aggregate these to display in a list form. However, before I am displaying them I filter them according to what I want to see in my list. When the list then appears I want the user to be able to choose from the list and it should be possible to choose more than one object from the list. So I filter the aggregated results and then let the end user filter the list using variables.

I have tried using checkboxes in my List Records, the problem with that is that I don't know what to choose for a variable. The choices will be put together and passed back to another screen where they work as dimensions for a graph, so I want the variables to have something to do with the object displayed from the record.

I am looking forward to your solution!

Hi Jack,

You can add to the Aggregate a boolean structure, then map the checkbox variable to the value of the boolean structure.


Hope it help.


Best Regards,

Frederico

If you want some checkboxes to be checked at runtime based on a certain condition, you can add an atribute to your aggregate.


Give the name : "IsSelected" for example and as value your condition that will return true or false.

Hi again, this was very helpful, thanks!

I want to use the checkboxes in a pop-up window and then display only the selected items in the parent window. What I can't seem to figure out how to use the same aggregate for setting the variable to true/false in both windows or how to pass the selected items to the parent window if I am using the aggregate in the pop-up. Am I missing something here or am I attacking the problem in the wrong way?

If I understand the use case, you don't need a popup. Just include an option Selected Only option in the filter section, that when selected only shows the selected items of the list. However a problem may arise if you have several pages in your list. Is that the case?

Hi Jack,

You cannot pass the data from the pop-up Screen to the main Screen. Instead, you pass the selection from the pop-up to the main Screen (via the Notify Action), then filter the result in the Screen. The only thing to be aware of is that when you refresh your Aggregate, the checkboxes set by the user on the screen will be reset to their default value, so you need some code to handle that (if that's what you need).