Programmatically select the next row in a table

I tried creating a select row event handler that increments up to the next table index Screen Shot 2021-12-16 at 5.23.34 PM

but as you can see after running no row is selected and the image is blank

Hey @ks23ever!\

No problem! Can you try moving this addition logic into the {{}} tags here, so somehting like:

{{table1.selectedRow.index + 1}}

I believe the issue here is that this is evaluating to index "0 + 1"

Hi, {{table1.selectedRow.index + 1}} (and also -1) works geat; added it to button events.
However, after sorting on a column, ik looks like the “initial” index is used, so “next” jumps to like random row, and not to the next row after the selected on.
Any suggestions to get this working.

1 Like

Hey @Evert — I unfortunately don't think this is easily accomplished out of the box. The table at the moment does not have a property to keep track of the modified indices after sorting by a column. We do have an outstanding feature request for this so I have gone ahead and linked it to this thread so we can keep you up to date as an update is shipped. In the meantime, the only workaround I can think of is a bit hacky. You could use a JS transformer and temporary state to keep track of the tables {{table.sort}} property and then generate an array of indices post sort. I'll attach an app export to this post for you to take a look at that should work for your use case here :slight_smile:
sorted_table_navigation.json (17.5 KB)

+1 on tracking modified indices. My team uses sorts and filters very frequently, and the auto-incrementing feature would be amazing if it could work in these scenarios.