To sort a list view by an expression calculated from SmartBox properties ?


Badge +1

Hi,


I'd like to sort my smartbox list view by an expression based on 3 others properties (something like "property1 X property2 X property3"), but sorting options only permit to sort the list by existing smartbox properties ; is there another solution that adding a property to the smartbox ?


Thanks for your help.


Sandrine


5 replies

Badge

Hi Sandrine,


Maybe you can solve this situation by following this steps



  1. add a data label in your list view (in the top ribbon, not as column list)
  2. configure an expression in this data label (matching your expression "property1 X property2 X property3")
  3. use this data label as filter for your sorting option

Keep us updated.


Regards,


Benjamin Bertram

Badge +1

Hi Benjamin,


I did it but the data label is not available in the sorting options (that's precisely my problem, sorry for my bad explanation...)


Sandrine

Badge

Sandrine,


And I was thinking filtering not sorting a list ...


Not sure it's possible without adding a field field to the smartobject.


Benjamin

Badge +4

The only way I see this to be done is creating a stored procedure against the smartbox. That stored procedure would have a parameter that would be the order by on the query against the smartbox.


select col from x


order by @orderByParameter


 


Afterwards, you have to update the sql server service instance on the SmartObjects Service Tester and create a SmartObject for the stored procedure.

Badge +10

Although I think this would work.  I would recommend working through K2 support as modifying the K2 databases including the Smartbox directly is not supported.


If it was a separate non-K2 database then of course there would be no issue with this approach.

Reply