- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 03:19 PM
Hello,
I'm trying to get a single score data visualization component to display the sum of an integer field based on a filtered data source that updates when options in a dropdown menu are selected.
When I add the data source to the single score as dynamic data binding I can no longer select anything in the metric field. I believe I am failing to structure the data needed for the metric to visually display it in the component when the data source is filtered based on previous selections.
I know I'm close since I can switch the metric over to a script and output the records to the console using:
var hours = 0;
for(var i = 0; i < api.data.requirement_lookup.results.length; i++) {
hours += api.data.requirement_lookup.results[i].estimated_hours.value;
}
console.log(api.data.requirement_lookup.results);
console.log(hours);
function evaluateProperty({api, helpers}) {
var myObj = {};
myObj.datasource = 'requirement_lookup';
myObj.id = 'Estimated hours';
myObj.aggregateFunction = 'SUM';
myObj.aggregateField = 'estimated_hours';
return myObj;
}
Any help with this would be greatly appreciated.
Thank you,
Robert
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:05 AM - edited 04-13-2023 08:46 AM
Hey @Johns Marokky,
I ended up building a separate custom data transform to get all of the data calculated as I needed.
I then threw that into a repeater with some card components to map the data out. I still have a little styling to correct but it worked out pretty well considering.
I'm definitely curious to hear your alternate method on this. I would be very appreciative to take in some more info on the topic to see what all is possible. It's great knowing there's a few ways to get things done in the UI Builder.
--Edit--
I also wanted to add that using the repeater and custom data transform lets me add/remove reports as needed without having to configure additional components. It's just an additional little bit of scripting to parse it out and drop it into that JSON object. I'm becoming a big fan of the repeaters in this aspect since I can customize how I want all consistent data to look and just iterate through it.
Also tagging @Sri Ram1 for my solution
Thank you,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:05 AM - edited 04-13-2023 08:46 AM
Hey @Johns Marokky,
I ended up building a separate custom data transform to get all of the data calculated as I needed.
I then threw that into a repeater with some card components to map the data out. I still have a little styling to correct but it worked out pretty well considering.
I'm definitely curious to hear your alternate method on this. I would be very appreciative to take in some more info on the topic to see what all is possible. It's great knowing there's a few ways to get things done in the UI Builder.
--Edit--
I also wanted to add that using the repeater and custom data transform lets me add/remove reports as needed without having to configure additional components. It's just an additional little bit of scripting to parse it out and drop it into that JSON object. I'm becoming a big fan of the repeaters in this aspect since I can customize how I want all consistent data to look and just iterate through it.
Also tagging @Sri Ram1 for my solution
Thank you,
Robert