Use button to insert row below current row

#1

I’d like to use the new Detail view on a table and be able to easily add a new row below the one being displayed. The workflow me and my collaborators have means “splitting” a row in two or more sometimes, and it’d be great if I could do this with one click! :slight_smile: Any ideas?

1 Like
#2

Hi William,

Interesting problem!

Here’s what I put togather!

document is here:

Here’s how it works:

For rows to show up in specific order, you have to apply some Sort to it. In the document I’ve linked I am using Category Number as a sort column.

Now, if we can generate a Category Number that is between thisRow and nextRow and assign that number to newly created record, the newly created record will automatically appear as a nextRecord. For example, if current row on which button is clicked is #5 and the next Row is #6, if we can assign, #5.5 to newly created row, it will appear in between. that is what the following formula does

if(Category.Filter([Category Number] > thisRow.[Category Number]).[Category Number].Sort().First(),(Category.Filter([Category Number] > thisRow.[Category Number]).[Category Number].Sort().First() + thisRow.[Category Number])/ 2, thisRow.[Category Number]+ 1)

if there is a next record, then it takes Category Number from that one + category number from current row and divides it in half (so in earlier example, it will (5+6)/2 = 5.5) - if the row is the very last row, then it adds 1 to CategoryNumber.

Hope this helps - would be happy to answer any questions (and would love to hear if other folks have different ideas)

Thank you,
Krunal.
Engineer - Coda.

5 Likes
Consecutive Row Numbers?
#3

Dear Krunal,

Thank you sharing this creative approach :trophy:and sharing in detail the steps :walking_man: your created to deal with this challenge.
Many users including me will be able to learn a lot and being encouraged to find solutions for challenges that today seem impossible to overcome.

Thats whats Coda about, FUN :bangbang:

3 Likes
#4

Thanks! It’s a beautiful solution Krunal, worked like a charm! :smiley:

I like that it’s built to be flexible regardless of how many new rows are created.