Unexpected behaviour of table.selectedDataIndex

I have a nested table using expandable rows in each row there is another table. I'm trying to edit values in the child table but I'm getting some unexpected results regarding the selectedDataIndex property.

image

The contractsTable is the parent table and the contractReportsTable is the child table.

Whenever I edit the quantity field and click the child tables default save button, it runs a script that fails at the line in the first screenshot. It seems like it fails because the selectedDataIndex property returns an undefined value. If i run the query manually (i enter the value in the quantity field and then click run directly on the query editor) the query works completely fine and the selectedDateIndex has the expected value (0 in this case, since i selected the first row).

Is this a bug or am i doing something wrong?

Hi @annadox,

Thanks for reaching out! This looks like a Retool bug. Can you try using i instead of contractsTable.selectedDataIndex? :crossed_fingers: Looks like that should work for your use case