Hi there. I have a dynamic page with two tables connected to a dataset. One of the tables will not always have content. I want this table to collapse (not show at all) if there is no content to feed through from the dataset.
I’ve tried this code but it does not work:
We want #testtable to be hidden on load if there is no content
Dataset= #dataset2
Element=#testtable
Text field in #dataset2 that is linked to #testtable= testfield
$w.onReady(function () {
//Wait for dataset1 to finish loading
$w(“#dataset2”).onReady(function () {
//get the value
const testfield = $w(‘#testtable’);
//collapse the image box if testfield is empty
if (testfield === ‘’) {
$w(‘#testtable’).collapse();
}
});
});