I have a list (Aggregate) from which I want to display to the user the value of one of its columns. There might be duplicated values in that column. I want to display each value only once. Grouping that column on the Aggeregate won't work for me as I need other columns as well. So my idea was to sort the list according to that value, and in each itteration of the list, to store on a local variable the last value. Before creating a widget to the current value, I check if the new value (list.current.entity.value) is different than the previous one stored on the local variable. If it does, I skip to the next ittereation without creating a new widget. I used a Card widget with an Expression widget within it to display the value and the Expression's OnChange event to call a local function that updates the local variable. Unfortunatelly it doesn't work. It seems that the handler isn't called. Attached is a screenshot (ignore the first condition at the Expression Editor). Any idea?
Hi Yaron,
Another option to achieve this is using web blocks, first use a list widget with your aggregate as the list, inside the list item place a new web block that will have an input parameter whi will be the current record of the list, and then inside the block, use that input in a new aggregate to show all of their columns that you want.
hope it helps, let me know if it works
Kind regards,
Sergio
Hi @Yaron Ben, I would suggest you use SQL with the distinct keyword; read more about it here.
cannot use SQL. As mentioned above, "group by" is already used
In an SQL query, you can use group by and distinct together; check this https://stackoverflow.com/questions/32702310/using-distinct-along-with-group-by-in-sql-server.