SOW - customise visualization charts

Hariskanthini
Tera Contributor

We are using Service Operations Workspace and in carousel, we are displaying a number of data visualization donut charts. We are getting the input from SowIncidentLandingPageUtils. The requirement is to customize the page based on the logged in user's group. We are currently showing charts from incident, change and problem table. If the user belongs to incident group, only incident charts should be shown. Similarly, for change.

 

I tried to pass a parameter from the client script but it is not accepting in the function. Please help me on how this can be achieved!

Client script:

 

/**
 * @Param {params} params
 * @Param {api} params.api
 * @Param {any} params.event
 * @Param {any} params.imports
 * @Param {ApiHelpers} params.helpers
 */
async function handler({
    api,
    event,
    helpers,
    imports
}) {
    
    const landingPageUtils = imports['sn_sow_inc.SowIncidentLandingPageUtils']();
    
    const conditionalVizConfig = await landingPageUtils.getConditionalVisualizationConfig(helpers);
    //const conditionalVizConfig = JSON.parse('answer');
    api.setState("conditionalVizConfig", conditionalVizConfig[0]);

    
    //const conditionalVizConfig = await landingPageUtils.getConditionalVisualizationConfig(helpers);
    //api.setState("conditionalVizConfig", conditionalVizConfig);
}