Feature Request – Sort Option

Viewing 4 reply threads
  • Author
    Posts
  • December 23, 2011 at 7:13 PM #3568

    Rturner003
    Participant

    I would like an option that when a text sort is used it can also not include the definite article. E.G. instead of putting the text ‘The King’s Speech’ under T it is put under K. Any example of this is the artist list in the ipod app of an iphone etc

    December 29, 2011 at 12:27 AM #5011

    Brendan
    Keymaster

    Hi,

    I am just using the built-in SQLite sorting functions. I don’t believe they support this kind of sorting, but I’ll look into it. No guarantees though.

    Thanks,

    Brendan

    October 21, 2018 at 3:57 PM #31264

    Izzy
    Participant

    Hi,
    Since the last post, is there any development regarding the sorting without the definite article.
    Thanks

    October 22, 2018 at 1:36 AM #31282

    Brendan
    Keymaster

    Hi Izzy,

    Since 2011 I’ve added many new features to Tap Forms (the original post year). One thing you can do now is you can add a Script field which can process the value from another field in your form to do some manipulation of the values.

    So you could write a small script that removes any occurrence of the word “The” in the movie, book, or song title and returns that in the Script field. Then you can sort your records on the Script field values.

    Here’s a script that will do just that:

    var movie_title = record.getFieldValue('fld-987c9aac738a4f0fa1d18395902b3fb1');
    
    if (movie_title.startsWith('The ')) {
    	movie_title.replace('The ', '');
    } else {
    	movie_title;
    }

    So it will search for the first occurrence of ‘The ‘ and replace it with nothing, effectively removing it. And the if statement checks to make sure it only does that if ‘The ‘ appears at the beginning of the movie title.

    Hope that helps!

    Brendan

    October 22, 2018 at 12:35 PM #31294

    Izzy
    Participant

    Hi Brendan,

    Thank you for your quick and exhaustive answer.

    I was able to add your example in my field by adding some modifications because I had more conditions. I still look for one or two solutions of display but the result already suits me.

    Thanks for your help.

Viewing 4 reply threads

You must be logged in to reply to this topic.