Current row index in expandable table

Hi guys,

New retool user here and loving it so far.
I am creating an app for real estate agents to manage documents during a sale.
They can create various lists (steps) in a project (sale) containing actions (todos).
I have a table (stepsTable) in which each row is a step and is expandable containing another table (todoTable) with actions:

My problem is that each row is loading the same actions, I can't get a way to access the containing row index working in the query.

I have tried 2 ways :

WHERE st.step_id = {{ }};


WHERE st.step_id = {{[i].id }};

but i always get the same data in each row. I don't want to use selectedrow as it changes each actionTable with the same content.

Any idea?

Thank you!

Where are you using the code in your snippets? Those variables are only accessible from within the table but those look like SQL queries, so it won't actually be passing the values in unless you use additionalScope in the triggers.

Yes you are right the code snippets are from the queries.
stepsTable triggers getSteps and in each row of stepsTable anested todoTable triggers getStepTodos.

step id = 1
triggers getStepTodos with step id= 1
Action 1
Action 2
step id = 2
triggers getStepTodos with step id= 2
Action 1
Action 2

I think the issue here is that each nested todoTable need to have a dynamic id/name in each row of stepsTable

I will have a look at additionalScope

Thank you

I was reading somewhere that nested tables do not work with Retool so I decided to use a modal instead. It's changing the way i imagined the app but will do the job