Use button to insert row below current row

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.

8 Likes