Hi @robinyoublind! There's probably a couple ways to go about this, but here's the potential solution that popped into my head:
-
Create a temporary state variable to store the index of the most-recently created claim, e.g
newestClaimIndex. -
Add two "success" handlers to your query to run after writing a new entry. The first triggers the search query to "refresh" the underlying data, and this should run synchronously. The second sets the value of
newestClaimIndex. I can't really give tips on how to do this without knowing what type of database/API you're using, but generally you can try setting it to something like{{searchQuery.data.claim_id.length}}(assuming it's appended as the last row to the underlying database). -
On your table, under "Row Selection", set the "default row" setting to "Index", and then set the index to use some JS like
{{newestClaimIndex.value ?? 0}}. This should (hopefully) set the index to that of the newest created row automatically.
There may be some hurdles with the way your search query/table filtering works that I'm not seeing, but give that a try and let me know if it helps!