Use component reference as table name with .recordUpdates

I am trying to get value from a component (a table component's name) and use that in javascript with .recordUpdates to use as my dataset in my code. It's not liking it or recognizing that it is a table component. This works because tableArea1 is the name of my table component.

var rows = tableArea1.recordUpdates;

But when I set my variable (stateActiveTable) to be equal to the text string 'tableArea1' and use it like below it doesn't work.

var rows = stateActiveTable.value.recordUpdates;

image

Is there a syntax where this works that I am missing?

@Orennia

Hey there :wave:

The way this is setup, Retool is just registering this as the string "tableArea1", not the table object. I am not sure if this is what you want, but would something like this work for you:

Possibly will test soon and post back results. Thanks!