There is at least one previous post about this topic, to get records not to sort by articles, where writing a script is suggested.
I have a music title database with titles in many languages, so getting the sorting right is important. I’m thinking of setting up two fields, a display title and a sorting title. The records would sort by the sorting title:
Étoile
Jahsager
Man in the High Castle
But the form would only include the display title, and so the sort would appear like this.
L’Étoile
Der Jahsager
The Man in the High Castle
Not like this:
Der Jahsager
L’Étoile
The Man in the High Castle
It’s a lot of work to do this obviously, so I’m checking to make sure there is no other easy solution. Also, I guess this will work?
Muchas gracias,
David
Hi David,
You could do this with a Script Field. Something like this:
function Sortable_Title() {
var title = record.getFieldValue('fld-3b1b39ccf20f43e583fe66b8aaa0602c');
var sortableTitle;
if (title.startsWith('A ')) {
sortableTitle = title.substring(2);
} else if (title.startsWith('An ')) {
sortableTitle = title.substring(3);
} else if (title.startsWith('The ')) {
sortableTitle = title.substring(4);
} else {
sortableTitle = title;
}
// console.log(sortableTitle);
return sortableTitle;
}
Sortable_Title();
You could enhance it to support other article words if you like.
Thanks,
Brendan
-
This reply was modified 6 months, 1 week ago by Brendan.