Connect to a dataset with javascript

Hi, is there a function to link a dataset to a table, using javascript code?

Thanks
Claudio

Do you really need a code to connect a dataset to a table ?

Yes, for example I want to have only one table object on the page connected to a dataset then, under certain conditions, connected to another dataset. Why are you surprised? :grinning:

  1. get data out of dataset - - > getCurrentItem()
  2. use the following example and replace the shown data with your own.
const myTableData = [
  {"name": "A", "num": 45},
  {"name": "B", "num": 34},
  {"name": "C", "num": 19},
  {"name": "D", "num": 59},
  {"name": "E", "num": 24},
  {"name": "F", "num": 96}
];

$w("#myTable").rows = myTableData;