Wrong API documentation value Table->rows : Attention velo API developers

As per the API docs:-
rows
Sets or gets the table’s row data.
Description
Setting the rows property sets the data of the table’s rows. A table’s data is stored as an array of objects where each object represents a row in the table.
But when I get a table’s row data, the array of objects is converted into an array of arrays as below

my code:-
var rows = [{ item: “Item Description” , quantity: 4 , amount: “$ 44” , },
{ item: “Item2 Description” , quantity: 5 , amount: “$ 55” , } ]

$w( "#table1" ).rows = rows; 

var tableRows = $w( “#table1” ).rows;
tableRows.forEach((item) => { console.log(Object.entries(item)) });
rows.forEach((item) => { console.log( “ROWS:” + Object.entries(item)) });

console.log:-
(4) [Array(2), Array(2), Array(2), Array(2)]
(4) [Array(2), Array(2), Array(2), Array(2)]
ROWS:item,Item Description,quantity,4,amount,$ 44
ROWS:item,Item2 Description,quantity,5,amount,$ 55

1 Like

I don’t know why you use Object.entries.
But try it like this


    tableRows.forEach((item) => { console.log(item) });
    console.log("--")
    rows.forEach((item) => { console.log(item) });

No problem for me

Kind regards,
Kristof.

thanks Kristof, I use Object.entries just out of habit. Not sure why the behavior is inconsistent when used though.
Anyways, not a deal breaker. Thanks.