Indeed the problem comes from the fact that the sort and the dir are linked to the query, but the results of the query being encrypted, it returns the values in an order which is not suitable.
Concerning the table this comes from a list on which I do not have the possibility of configuring the sorting at least not dynamically, I can choose a field on which to sort, but I cannot do it for each column, it would be necessary to variable which is not taken into account by wappler at the moment, I don’t know if @teodor has an idea to get around this problem of dynamic sorting in a list