Dashboard block query not showing in object?

Trying to get a time series query in a custom html block, the query is returning data

<script>
  console.log(DashboardBlock.input)
  </script>

but when i print the Dashboard.input object, queries is empty

Am i missing something obvious ?

Iā€™m guessing your console.log() is written outside of any event callback and thus it is firing immediately when the block mounts - at which point you do not have DashboardBlock.input.queries because the requests have not resolved to data yet.

Instead, try this ā€¦

<script>
  DashboardBlock.on('queryChange', (e) => {
    console.log(e.queries); // or
    console.log(DashboardBlock.input);
  });
</script>
1 Like

That was it thank you!