How to bind a PA indicator dynamically to Data Visualization component
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 02:17 PM - edited 10-26-2023 02:17 PM
I am trying to show a Line Data visualization dynamically when selected from a dopdown. I have the sys_id of the PA Indicator, but I want to bind it to the data visualization component but I'm failing to do so. Can anyone help me in this??
- Labels:
-
UI Builder : Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 01:32 AM
Hi, To set up PA indicator dynamically, in the data source section inside config, you need to pass script and same for Metric and other sections.
IN data source section, pass below code by replacing with proper values & requirements
return [{
"allowRealTime": false,
"allowTotalValue": false,
"indicatorType": "2",
"isScriptedIndicator": false,
"label": "Sample Dynamic Indicator",
"sourceType": "indicator",
"uuid": {
"breakdowns": [{
"sysId": "breakdownSysId",
"elementSysIds": [
"elementsysid"
]
}],
"indicator": "indicatorsysid"
},
"id": "uniqueId"
}];
In Metrics section, pass below script.
return [{
"dataSource": "uniqueIdofDatasourceconfiguredinPrevStep",
"id": "uniqueMetricId",
"aggregateIndicator": "",
"frequency": 10,
"numberFormat": {
"customFormat": false
},
"axisId": "primary"
}];
In trendby pass below script,
return {
"trendByFrequency": "date",
"trendByFields": [{
"field": "anything",
"metric": "uniquemetricIdcreatedinprevStep"
}]
};
After all the setup, you should be good to go.
Mark this as Helpful / Accept if this solves the question.
Mark my answer as