Accessing Table row index for Action Events

Hi,
I have searched countless posts and I can't figure out how do do something seemingly straightforward :

I want to delete a table row with an action button. The table is in a modal.
Here is what it looks like :

My table is populated with an array variable : 'currentLignesList'

I understand there is no 'deleteIn()' function for an array variable.
So the advised method was the use of 'splice()'

Now, splice needs a row index, which I can't get my hands on ...
'table.selectedRow.index' was referenced in a forum post, but does not work.

I understand I get the data with currentRow, currentSourceRow, and even selectedRow, but I cannot get the index, ...
and I cannot perform a 'delete' with only the data ...

What am I missing ?

Hi @MFP,

You may be looking for formEcriture_tableLignes.selectedDataIndex

Also, a helpful way of finding what can you reference is right clicking on your table and click "View state":

This will show you what is it you can use anywhere in retool.

Wow !
Thanks for your quick reply.

I had looked into the state window, but no game :
Reason is I did not really want to select a row on my table, just click on action buttons, so I set 'Row selection' to 'None'
Therefore, selectedDataIndex was not available in the state window.

What confused me is neither currentRow, currentSourceRow, or SelectedRow appeared in the state windows HOWEVER, i could access correct values with code : formEcriture_tableLignes.currentRow would bring the correct values WHILE not available in the state !

When setting 'Row selection' to 'Single', it works nice :slight_smile:

Thanks.

1 Like