In this tutorial, we will demonstrate how to sort a datalist by multiple columns. In this sample, we will focus on sorting by three columns: Country, first name, and last name.

Form Design

List Design

Currently, Joget doesn't offer the option to directly sort the list by multiple columns natively, however there is a method to do so by using the Database SQL Query.

SQL Select Query

This SQL query will sort the datalist by country, then first name, then last name.

SQL Query
SELECT c_country
  , c_first_name
  , c_last_name
        SELECT c_country
          , c_first_name
          , c_last_name
        ORDER BY
            c_country asc
          , c_first_name asc
          , c_last_name asc
        LIMIT 18446744073709551615


Download the sample app:

  • No labels