Check it table existe

Hi

Have a datamapper just listing data from a csv file.
But when the csv file is empty, the template fails.
How do i make a check on if the table even exists ?

Tried this?
var text = 'Antal dokumenter ikke opdateret inden for de sidste 7 dage: ';

if(record.tables.docs) {
text =+ record.tables.docs.length + ’ stk.';
}
else {
text =+ ‘0 stk.’;
}
results.html(text);

To check wether a detail table exist and whether it is also not empty you can use the following:

if ("docs" in record.tables && record.tables.docs.length > 0) {
	// ...
}

Thanks just what I was looking for.