Set value of a checkbox from field in database

I want to connect a checkbox value (not the state!) to a field in a database. So that the value of the field appears next to the checkbox.

I found some code but it does’t work. Anybody has a better suggestion?

$w.onReady(function () {
$w(“#date1Checkbox”).value = $w(‘#dynamicDataset’).getCurrentItem().date1