I would like to be able to run simple calculations on TotalAgility (KTA) table cell field values on a form. For instance, multiplying a value in one cell by a unit price in another cell to get the total price for the line.
This can be done a few different ways. The normal approach would be to extract the field values, and then run calculations using business rules in field validation.
Another option could be to use a Database Query action to populate a custom database table with the table data, then using another Database Query action to run a Stored Procedure to perform the calculations and return the Stored Procedure value back to the form.
var field = thisForm.controlManager.getControlByName("TableTest");
var RowSelected = field.selectedRow;
var colA = parseInt(thisForm.controlManager.getControlByName("TableTest").kfxData.field.table.rows[RowSelected].cells.value);
var colB = parseInt(thisForm.controlManager.getControlByName("TableTest").kfxData.field.table.rows[RowSelected].cells.value);
var totalAB = colA + colB;
This script takes the value from column A and adds it to column B and provides the calculated total in a "TOTAL" column. The script can be adjusted to suit your requirements.