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 ?
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>
That was it thank you!