Widget Data Not Included in Downloaded CSV After Calculation (Table Widget)
Hey all,
I'm using a script to calculate a total value, and inserting said value, into a table widget. It sums up the quantity column, and presents that sum in the last cell of the column. This displays information correctly, and works as a widget. However, when I go to download the csv of the widget, the file doesn't include the calculated value, it's empty (which is what it is before the value is replaced). If I download as PDF or Image, the calculated value is included. Does anyone have a solution/fix so that the table includes the value when downloaded as csv? I imagine that this is happening due to where/when the data is being replaced. Thanks in advance.
widget.on('processresult', function(widget, query) {
var results = query.result.rows();
var total = 0;
$.each(results, function(i, row) {
if (i < results.length - 1) {
total += row[5].data;
}
});
var lastRow = results[results.length - 1];
lastRow[4].data = total;
});
Hello turtleData123,
Thank you for your question. Currently .csv exports are done through a headless browser session, so Widget scripts are not applied like they are with other export types. We are working on improving that process. Can you open a support ticket so we can capture your need here and make sure we address it?
Thank you.