Sorting your data the way you want

Since version 1.4, ConfiForms plugin supports sorting of records stored.

TableView and ListView macros now have a new parameter 'Ordering/Sorting rules to apply on entries dataset' to control the ordering of records shown. It uses SQL like syntax with reserved words ASC and DESC for sorting directions

Again, this tutorial will be based on 'Creating a simple form'. But we have added one more field (nrOfPages), that stores numbers.. and it is for storing number of pages in a book.

Let's enter some data:

  • bookTitle: Programming in Objective-C
    bookAuthor: Stephen G. Kochan
    nrOfPages: 100
    bookISBN: 0321967607

  • bookTitle: Android Programming: The Big Nerd Ranch Guide
    bookAuthor: Bill Phillips
    nrOfPages: 200
    bookISBN: 0321804333

  • bookTitle: Windows Store App Development: C# and XAML
    bookAuthor: Pete Brown
    nrOfPages: 150
    bookISBN: 1617290947

Here are some examples on how the data could be sorted (Of course, sorting could be combined together with filtering and used together. Learn here how to use filters).

To sort the dataset by number of pages, in ascending order nrOfPages ASC
To sort the dataset by book author name and number of pages, in ascending order bookAuthor ASC, nrOfPages ASC