How do I order the scenes from my novel project, resetting the counting order according to the chapter?

Hi, I’m totally new to Coda (and I’m amazed by it), but recently I found an obstacle to pass, which is making me waste too much time (instead of actually write something).

the picture above show the table “Scenes”

I’m a rookie writer who enjoys to draft a narrative dividing it by Scenes, Characters and Locations . So basically I created 3 tables with those data. The table Scenes includes a column that indicates which Characters participate in which scene and another column that shows in which location the scene is going to happen. I had no problem doing that.

The second main step I tried (and succeeded) was to order each scene in the Scenes table by its row position in the table and automatically rename each scene by that new order. So, for example, if I create 5 scenes (and name them scene 1, scene 2, scene 3 and so on), but decide that the very last scene I wrote (scene 5) is, now, gonna be the second scene to happen, I drag that scene (from the 5th row) and drop on its new position (the 2nd row). All the scenes get renamed by their new position.

But the step I am trying to succeed now is to adjust the number of the scene (its title, ex: scene 3, scene 4) according to its actual moment in the chapter (ex: the title of the first scene in chapter 1 is “scene 1”, in the chapter 2 is also scene 1, considering scene 1 from chapter 1 and scene 1 from chapter 2 different scenes, but both the firsts of their chapters). The scene chapters are put into a column in the Scenes table. Currently, I am viewing my it using the Group tool in the table options, grouping all the scenes by chapters. So, if the scenes 1, 2 and 3 belongs to chapter 1 and scenes 4 and 5 to Chapter 02, Coda will conveniently separate the scenes and put them into a new grouped view, but won’t rename the chapter 2 scenes reset the counting (which is the way I would like to visualize (and categorize) my scenes, after all, the first scene of chapter 07 (for example) is not “Scene 25”, but Scene 01).

I’m not really sure if I could explain well my issue, but I really appreciate who could help me with a formula or a way to organize this. Thanks from Brazil!

1 Like

Hey! To make an auto counter that resets per chapter you can do:

ThisTable.filter(chapter = thisRow.Chapter).Find(thisRow)

And boom! You done.

2 Likes

Oh, my hero, thank u so much, it worked like a charm! By the way, not sure if I can ask this simple question here, but is there a way to generate a n-character unique ID (instead of that RowID in order) for each row? ex: an id with 10 numeric characters?

Other than that, thank u so much!

Hi Andre,

You can use this formula

Regards
Rambling Pete

I have set up an example that will generate a 10 digit text string with random numbers. It’s a bit slow, but it does work.