Can't Read a Table

I am using code I have used before to capture a value from a selected row in a table i.e.
localStorage.setValue ('Name', table1.selectedRow.data.Name);
I am using it in a new table and I find it doesn't work.

I am getting a message: "Cannot read properties of undefined reading Name".

The field is named properly. Are there are any suggestions as to why this doesn't work?

Mike

1 Like

Hey @mdsmith1,

Unless this is how your row data is structured, you don't need to use .data when using selectedRow, therefore table1.selectedRow.Name should work

Miguel:

Yes, it worked. The code came from a Legacy Table and I was using it on the new Grid and that may have been a factor.

Thank you so much for this.

I will mark your answer as the "Solution".

Mike

1 Like