Custom HTML Block - Data Table Query

In a Custom HTML block within a dashboard, I am using a data table query [data-table-0] and I have the filter on match for a certain row in the data table [radius=20] I want to call it that number of “20” into my custom HTML block. so far I am using DashboardBlock.input.queries[‘data-table-0’] and it is not calling it / working. What is the proper format for calling a value (number) within a data table?

Example: I want to set the variable ScaleRadius to be calling the number from the data table query filter
var scaleRadius = 20; instead of 20, this would call the data table query so it can be used below in replacement of the scale radius
var radius = 1 + (Math.abs(DashboardBlock.input.queries[‘time-series-1’][i].value)/scaleRadius);

Thanks!

1 Like

Hi @Elisa_Cui,

First as a quick tip, this block is prefilled when it is created to display the available DashboardBlock object. This object will show you the structure of your available data, and will even display your query results once a query is configured.

I use this tip often when working with this block, it can be hard to keep track of the object structure. Also, keep in mind that your Dev Tools Console is also logging errors from this block, so be sure to check those out.

I created a Custom HTML Block with a Data Table query for radius=20. Without changing the configuration of the block, I can see my current DashboardBlock.input object:

Using this prefilled configuration, I can traverse to find the value I am looking for, within the radius object!

Let me know if I can explain further or if you have any additional questions. :smile:

Thanks,
Julia

What do you mean by traverse? I tried that and couldnt find the same line of code that you received.

Also, based off of what you have, would this give me the correct answer?
var scaleRadius = DashboardBlock.input.queries[‘data-table-0’].query.$or[0].raidus.$eq;

Hi @Elisa_Cui,

When I say traverse, I mean that I made my way through the object visually so I would know where the value existed and how to reference it properly.

Yes, based on my example, the value would be located at DashboardBlock.input.queries[‘data-table-0’].query.$or[0].raidus.$eq.

Let me know if you have further questions!

Thanks,
Julia