Hi all,
I have an aggregate that displays some data and a webblock in each row to fetch additional info.
This additional info consists of 10+ analysis that are colour coded (red, orange, green). I would like my aggregate to be sorted on the amount of red values found inside the webblock. So ideally give back a number (4) to the parent screen and sort the aggregate on this number highest to lowest.
Is there way to do this?
Max
Hi @Max de Groot ,
I would as a first option look at retrieving all the information with the list aggregate (or data action), and immediately sort on that while retrieving. This also avoids performance hit for having separate extra query for each row. (unless the rows have very much of very complex data)
Is this not a feasable option for your screen ?
Dorine
And just to expand on the question of sorting based on data coming back from the webblocks, I think this would be very messy and difficult, I haven't tried it, but it is very possible that on every sort, the whole list gets removed and re-added to the dom, causing all the webblocks to get instantiated again.
Hi Dorine,
Yeah I have about 14 fetches at the moment that all come from different tables inside a SQL database. Since the data inside the SQL already was calculated this is the simplest and quickest way to get it in OutSystems, but it causes some issues when loading 100 records that all need to be compared to those 14 fetches and given a color based on their values.
I think I am going to this in a list or SQL statement, but both are also going to be a bit messy probably.
I agree with your point on the event refreshing the list and causing the fetch to run again...
Thanks!
Hi,
For complex calculation, just use the data action and sort its output.
In the data action, for every record, calculate the reds and put the result in the output.
It is the most simple way.
thank
Hey @Max de Groot,
I think an OML example of what you are trying to achieve would help to understand and design a solution that would both perform and achieve the color based and sorting outcome you want, let me know if you can add an OML for me to test and give you back some feedback.
Best Regards,
J.P.