Error with rows.length

Hello, I am following the "Scripting Retool" page but

var rows = tabla_listar_inventario.data;
var errors = "";
var total = rows.length;

rows.length is responding "undefined"
the table has 3 rows

Any idea how to solve it?

rows = tabla_listar_inventario.data.length