- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:57 AM
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);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 03:59 AM
Hi @Hariskanthini ,
You may follow the below steps
1. Add a new transform data broker to fetch current user's groups (refer to screenshot, a ACL will be required for the new data broker)
2. Remove the UpdateDonutsConfig client script from the Page ready event, and then add the UpdateDonutsConfig client script on the new data broker's Data fetch succeeded event (refer to screenshot)
3. Update the UpdateDonutsConfig client script to filter donut configs based on the fetched groups(refer to the screenshot)
Please mark it helpful, if it answers your query.
Thanks,
Haseeb Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 03:59 AM
Hi @Hariskanthini ,
You may follow the below steps
1. Add a new transform data broker to fetch current user's groups (refer to screenshot, a ACL will be required for the new data broker)
2. Remove the UpdateDonutsConfig client script from the Page ready event, and then add the UpdateDonutsConfig client script on the new data broker's Data fetch succeeded event (refer to screenshot)
3. Update the UpdateDonutsConfig client script to filter donut configs based on the fetched groups(refer to the screenshot)
Please mark it helpful, if it answers your query.
Thanks,
Haseeb Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:12 PM
Thank you so much for your detailed solution!