To install EncodingSortForSQL and use it in your project, you just need to follow the steps below:
Both server actions use the structure SortAttribute which should be checked automatically, otherwise check it manually.
The sever action DEPRECATED_EncodingSortForSQL is only required if you are upgrading from a former version of this component for backward compatibility, but you should consider replacing it soon.
There are two options to use the library:
If no manipulation of the sort criteria is desired, the new server actions can be used directly as a function in an expression, as was possible with EncodingSortForSQL.
BuildSafe_SortClause( TextToSortAttributes(Text, Default) )
Alternatively, both server actions can also be used as individual elements in a flow. This allows to access the list generated with TextToSortAttributes and manipulate the sort order before using BuildSafe_SortClause to generate the sanitized text to be used in the advanced SQL. This is useful to add or remove attributes or to force a special order, for example.
This component also comes with a demo app that lets you try out both functions and shows how to use them.
EncodingSortForSQL is a simple function to encode a dynamic sort string that can be used in an advanced SQL query. The implementation is based on the article How to enable dynamic sorting in a table fed by a SQL query. Since the component provides a function, it can be called directly in the parameter of the advanced SQL action as an expression: