I hope this can help you at least get started, but this is very complex and requires a developer to likely make it happen. Hopefully, this can at least help with the direction.
You can use an external library, something like this: https://github.com/nicolaskruchten/pivottable?utm_source=cdnjs&utm_medium=cdnjs_link&utm_campaign=cdnjs_library
Add the script to the footer of your app:
<script src="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.23.0/pivot.min.js" integrity="sha512-XgJh9jgd6gAHu9PcRBBAp0Hda8Tg87zi09Q2639t0tQpFFQhGpeCgaiEFji36Ozijjx9agZxB0w53edOFGCQ0g==" crossorigin="anonymous"></script>
Add this to the header of the app:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.23.0/pivot.min.css" integrity="sha512-BDStKWno6Ga+5cOFT9BUnl9erQFzfj+Qmr5MDnuGqTQ/QYDO1LPdonnF6V6lBO6JI13wg29/XmPsufxmCJ8TvQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
Let’s assume you’re able to load all these records on the page (in my example, its component_3.
Next, I would add an HTML snippet to the page where we want the pivot table to appear:
<div id="output"> </div>
Finally, we can take our data and display it in a configurable pivot table by adding this to the JS section:
TB.render('component_3',function(data){
console.log(data.records);
var utils = $.pivotUtilities;
$("#output").pivotUI(
data.records,
{
}
);
});
You will now have a custom configurable pivot table:
The issue now is that the fields are identified by id vs their name. I’m sure with a bit more tweaking we can convert the field ids to names.
Here’s my example:
https://localtest.tadabase.io/adam-pivot#!/test-data
Once you’ve gotten all the settings configured how you like it, you can set it to not show the UI and set all the parameters programmatically in the Javascript, like this:
TB.render('component_3',function(data){
console.log(data.records);
var utils = $.pivotUtilities;
$("#output").pivot(
data.records,
{
rows: ["field_36"],
cols: ["field_38"]
}
);
});
I hope this helps, this is a bit beyond the scope of our support, but I’d be happy to keep assisting if I can.