Workspace - UI Builder - Bar chart drilldown

jparman
Tera Guru

Hi!

 

I currently have a workspace with a Bar chart.

 

 

jparman_0-1695777078914.png

 

What I need to do is once you click on the bar chart it will drill down to another bar chart on another page where it will be grouped by operating system. This is simple to do with reports where you have drill down reports, however I don't know how to do it with workspaces.

 

Here are the things that I have done so far:

1. I have 2 pages. Homepage and os page.

2. Homepage has the Bar chart Overview Servers

3. os page have 2 Data visualization (a bar chart and a list). This page has the following page parameters:

jparman_2-1695777453948.png

 

 

4. I have created a Link to destination event on Overview servers Bar chart with the following parameters

event.png

5. I used these parameters in the "list data visualization" on os page. This worked as expected where it showed the correct list:

jparman_4-1695779141578.png 

jparman_5-1695779942486.png

6. However for the bar chart it is showing Loading Visualization data. I think I am lacking the metric and group by info but I am not sure how to populate. 

jparman_6-1695781837845.png

 

jparman_7-1695781869691.png

 

Thanks in advance!

 

 

 

6 REPLIES 6

Nootan Bhat
Kilo Sage

Hi @jparman,

In data visualisation, data source property has its own format. Passing the table name wont work in data source.

Either dynamic data binding should be in correct JSON format or else you can use the script option.
I have provided a solution in https://www.servicenow.com/community/developer-forum/ui-builder-single-score-make-filter-with-bind-d...

 

Also please define the metric and group by conditions properly/ pass the required data from the 1st page.

 

Hope it helps!

 

Thanks

Nootan 

Hi @Nootan Bhat 

 

How can I get the table name and the query filter from the parameter?

 

jparman_0-1695972655537.png

 

Hi @jparman,

You can use the api.context.props.VARIABLE_NAME

Refer https://developer.servicenow.com/dev.do#!/reference/api/utah/client/apiAPI#api-context-props

 

Thanks

Nootan

Wow thanks!

 

For the metric I am trying to get the computer count

jparman_0-1695973549937.png

 

jparman_1-1695973564650.png

 

 

How do I write it on the script?

I am not sure what to put in the aggregatedField

jparman_2-1695973617297.png