[SOLVED] Trouble Using a Data Resource as a Data Source for UI Builder Visualization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2024 04:17 AM - edited 07-18-2024 10:56 PM
Hi!
I'm having a hard time figure out how to use a Data resource as a Data source for Data visualization component in UI builder.
To simplify my testing i made a Transform data resource that just returns a hard-coded object.
demo_broker:
script:
function transform(input) { var var_input = input; var output = [{ "metadata": { "dataSourceLabel": "Incident", "dataSourceType": "table", "eventData": { "table": "incident" } }, "data": [{ "value": "67" }] }, { "metadata": { "dataSourceLabel": "Incident", "dataSourceType": "table", "eventData": { "table": "incident" }, "groupBy": [{ "id": "incident_state", "label": "Incident state" }, { "id": "priority", "label": "Priority" } ] }, "data": [{ "incident_state": "In Progress", "priority": "1 - Critical", "value": "11" }, { "incident_state": "Closed", "priority": "1 - Critical", "value": "10" }, { "incident_state": "Closed", "priority": "5 - Planning", "value": "9" }, { "incident_state": "New", "priority": "5 - Planning", "value": "6" }, { "incident_state": "Closed", "priority": "3 - Moderate", "value": "5" }, { "incident_state": "In Progress", "priority": "2 - High", "value": "4" }, { "incident_state": "On Hold", "priority": "1 - Critical", "value": "4" }, { "incident_state": "New", "priority": "3 - Moderate", "value": "3" }, { "incident_state": "In Progress", "priority": "3 - Moderate", "value": "3" }, { "incident_state": "New", "priority": "1 - Critical", "value": "2" }, { "incident_state": "New", "priority": "4 - Low", "value": "2" }, { "incident_state": "In Progress", "priority": "5 - Planning", "value": "2" }, { "incident_state": "Closed", "priority": "4 - Low", "value": "2" }, { "incident_state": "On Hold", "priority": "3 - Moderate", "value": "1" }, { "incident_state": "On Hold", "priority": "4 - Low", "value": "1" }, { "incident_state": "On Hold", "priority": "5 - Planning", "value": "1" }, { "incident_state": "Resolved", "priority": "5 - Planning", "value": "1" } ] } ]; return output; }
Output:
How i set up the data source for my component:
There is no visualization:
However, if i copy and paste the data into the Use static input field the visualization works as shown below:
What are my options here? How can I get the data resource to work directly for visualization? Any help would be appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 10:54 PM
Issue was that i had to tick define data manually, then while hovering over the input box select the bind data. Should look something like this: