Slates - Fields not sorting correct

Greetings from LA! I am currently on a shoot and try to keep our shotgun up-to-date as we move along. We are using Setellite for our onset notes, and at the end of the day export these as a CSV to import into shotgun. Match to our fields on import etc. - all works fine.

We have fields called Slate Number (17A, for example, in the american nomenclature) and Take Number.

I noticed that internally shotgun uses the Slate Name field when linking to a shot, so I am externally concatenating Slate Number and Take Number (into 17A-1, for example)

So far, so good.

I am now seeing that sorting doesn’t really work as expected.
Slates like 17 and 17A come before 2, which comes before 20 and so on.

Is this expected behavior?

Thanks, Alex

4 Likes

We are using padding with zeroes to have stuff sorted properly alphabetically. In your example 2 should be 02, in that case order becomes 02 > 17 > 17A > 20 as you would expect.

3 Likes

Hi Alex,

The Slate Name field is a text field so when you sort that, we sort based on alphabetical contents. We don’t sort numerically like we would for number fields.

Here is a bit of a :nerd_face: example from StackExchange (a great resource): https://softwareengineering.stackexchange.com/questions/127639/why-do-some-sorting-methods-sort-by-1-10-2-3

Basically, your path of least resistance is probably what @Hendrik_Proosa suggests, prepending with 0 based on the largest number you’ll encounter.

3 Likes

Hi Patrick, thanks for that. I understand the way the sorting works - I was just hoping there would be an easier way around.

I would like stay away from leading zeros in the Slate Name to always be able to reference back to the editorial QTs. So I guess my workaround is to introduce a new field based on Slate Name that does have leading zeros and is only used for sorting.

Cheers, Alex

1 Like

This additional sorting field is what we use too, if necessary. In some cases codes sort alphabetically in different order than is the logical progression of scenes/sequences or whatnot, for example when there are short abbreviations used, and padding doesn’t solve this kind of issues.

1 Like