Trying to parse ui builder indicators metric values to a service catalog via url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 12:04 PM - edited 07-24-2024 11:50 AM
Hi ,
We have a dashboard built using metrics from pa indicators using ui builder.
We are trying get those metrices value on to a service now catalog item variables.
we are trying to invoke this via link , whenever they click on link report link they needs to be redirected to the catalog item and show up the metrics value on one of it variable(autopopulate).
can any one help with suggestions in the code , as it is failing to pass the value to the url.
Thanks in advance!!
Hi ,
We have created a script that is running on ui builder link but when we actually go to dashboard and try to click on the huperlink its not redirecting to expected instead it is opening homepage.
code which worked
function openCatalogItemWithMetric({api}) {
var metricValue = api.data.verticalA_headlinemetric2.output.result[0].value_unit;
var metricValue2 = api.data.getmetricsofciodashboard.output.VerticalA.headlineMetrics[1].metricLabel;
const catalogItemUrl = `https://cognizantdemo7.service-now.com/sp?id=sc_cat_item&sys_id=6389e9f31b9b0a10660477f58d4bcb7e&sys... encodeURIComponent(metricValue) + '&sysparm_metricValue2=' + encodeURIComponent(metricValue2);
window.open(catalogItemUrl, '_blank');
}
can anyone tell us how to trigger trigger this script when the link on the dashboard is clicked,, tried event handling but didn't succeed . any suggestions or script or process changes please let us know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 11:49 AM
Hi ,
We have created a script that is running on ui builder link but when we actually go to dashboard and try to click on the huperlink its not redirecting to expected instead it is opening homepage.
code which worked
function openCatalogItemWithMetric({api}) {
var metricValue = api.data.verticalA_headlinemetric2.output.result[0].value_unit;
var metricValue2 = api.data.getmetricsofciodashboard.output.VerticalA.headlineMetrics[1].metricLabel;
const catalogItemUrl = `https://cognizantdemo7.service-now.com/sp?id=sc_cat_item&sys_id=6389e9f31b9b0a10660477f58d4bcb7e&sys... encodeURIComponent(metricValue) + '&sysparm_metricValue2=' + encodeURIComponent(metricValue2);
window.open(catalogItemUrl, '_blank');
}
can anyone tell us how to trigger trigger this script when the link on the dashboard is clicked,, tried event handling but didn't succeed . any suggestions or script or process changes please let us know