////////////////////////////////Here is my code i want to display on the table:
.then( (items) => {
let count = items.length;
for (var e = 0; e<count; e++) {
let name = items[e].name;
console.log(e);
//insert table row value then loop again
}
I want to display my console log results into a table.
Can anyone help me? Thank you.
Just make sure the dataPath property in your $w ( “#table1” ). columns definition matches the field id in the collection. In your case “dataPath” : “name” so the field id in the collection should be called “name”.
.then( (items) => {
let count = items.length;
let objROW= [];
for (var e = 0; e<count; e++) {
let name = items[e].name;
//THE MOST IMPORTANT, convert your result to an Object.
objROW[e] = { names: name };
}
$w("#table1").rows = objROW;