Any way to insert row to top of the table

I need to insert rows to top of the table using api. So then i can get last one row with query as last row added to table that have specific column value. But as i see i can only add values to bottom and get only from top, so for big data it can be costly

1 Like

Hi @Timofey_Bolgarin - Unfortunately the API doesn’t provide the ability to add rows to the top of a table, nor change the order of existing rows. Coda tables do have a natural sort order, but most often tables and views are sorted by a column value instead. You could consider adding a column that contains the date the row was added, and then sort on that column’s value (descending) to get the newest rows to appear at the top.

1 Like

This keeps coming up as a nice to have. When adding new items to tables, it’s very common to want to see them at the top and not have to scroll down on large tables to see it, and moving it from the bottom to the top is clunky.

4 Likes

Agree - would be super useful, especially for large tables.

There is row property called “created on”. Add it to your table, and sort it in descending sequence. Alternatively you could use the property row id.

There are advantages and disadvantages to both approaches, but either will get you there in 99% of cases.

A great suggestion! Unfortunately, you sacrifice manual row ordering, which is critical in my scenario, so I’ll just have to deal with the rows being down at the bottom for now.

As they say in the classics: “you pays your money, you takes your choices…” :wink: