How to get the next and previous row_id

Hi there, is it possible to get the next and previous row_id? This so that next/previous buttons can be added to a details page.

1 Like

Hello @DickHoning,

While we do have a get_adjacent_database_table_row endpoint in the API, I don’t think there’s any way to do this at the moment in the application builder, but it’s certainly a useful addition to our single and multiple row data source types. I’ll share this with the application builder team.

Cheers,
Peter Evans

1 Like

Just thinking out loud here - and I may be barking up the wrong tree - but you could try creating 2 new formula fields in your table. One would be row_id() +1 and the other would be row_id() -1.

Then you could add a link in your application builder with those fields.

I haven’t tried it, but I can’t see why it wouldn’t work…

Thanks for your thoughts. This us not gonna work as row id are not necessarily sequential. Also, you need to know when it’s the first or last row in order to not display the previous/next button. Ideally you have built in functionallity for this.

Hi @spook - while that may work in some cases,

  1. As @DickHoning said, it assumes that the row ID is sequential, which it could not be.
  2. The first and last records will have invalid previous and next records, respectively.

I’ll have a chat with our team and see if in the future, this could be implemented properly.

Cheers,
Peter Evans

1 Like

Yeah that makes perfect sense!