UI Builder - Data Visualization - Visualization clicked - Data Drilldown

Zackary Sirrine
Tera Contributor

Hello,

 

I have a client that I am building an experience for. The experience is mostly data visualizations (donuts specifically). The client would like for a list to open when they click the slices of the donut. 

 

This is too vague and has not worked no matter the amount of troubleshooting:

Add drill-down events when using 'Dashboard' component(sn-dashboard) on landing pages in UI Builder ...

 

This uses a handler called Advanced dashboards - redirect, which does not exist in my client's environment (has latest update). Any idea why?

Add a drilldown event to a data visualization in a technical dashboard

 

If someone could please point me in the right direction that would be amazing!

1 REPLY 1

Kiera
Tera Expert

Hi Zackary,

 

For donut visualizations specifically, I have been able to add 'click through' functionality before by creating a generic client script for my variant called 'navigate to simple list' etc and having the below script:

 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
* @Param {any} params.imports
* @param {ApiHelpers} params.helpers
*/
function handler({
    api, event, helpers, imports,
}) {
    const { app = {}, props = {} } = api.context;
    const { payload = {} } = event;
    const { params: _params = {} } = payload;
    const { listTitle, query, table } = _params;
    const DEFAULT_VIEW = 'YOUR_VIEW_NAME';

    let params = {
        listTitle,
        listView : DEFAULT_VIEW,
        query,
        table,
    };

    api.emit('NAV_ITEM_SELECTED', {
        route: 'simple-list',
        fields: {
            table: params.table,
        },
        params,
    });
}
 
I then added a 'Visualization Clicked' event to the donut data visualization with a handler of 'Execute - client script' which called this client script.
 
It should automatically pass through the table/ query of the donut visualization into the client script and can therefore work for multiple donut visualizations.