
So someone recently helped me out with a sheetworker that would take the product of two attrs within a repeating section row and then sum these numbers across all rows of the repeating section: on("change:repeating_extras:varex1 clicked:repeating_extras:itemexw clicked:repeating_extras:itemtux remove:repeating_extras", function() { getSectionIDs("repeating_extras", function(IDArray) { var fieldNames = []; for (var i=0; i < IDArray.length; i++) { fieldNames.push("repeating_extras_" + IDArray[i] + "_itemex"); fieldNames.push("repeating_extras_" + IDArray[i] + "_varex1"); } var total = 0; getAttrs(fieldNames, function(values) { for (var i=0; i < IDArray.length; i++) { total += (parseInt(values["repeating_extras_" + IDArray[i] + "_itemex"])||0) * (parseInt(values["repeating_extras_" + IDArray[i] + "_varex1"])||0); } setAttrs({ "extraload": total }); }); }); }); For example, if the first row had itemex=2 and varex1=3 and the second row had itemex=4 and varex1=5 then extraload would be (2*3)+(4*5)=26. But now I want to add a third attr to the product. I tried this but it doesn't work (in fact it breaks the sheetworker): on("change:repeating_extras:varex1 clicked:repeating_extras:itemexw clicked:repeating_extras:itemtux remove:repeating_extras", function() { getSectionIDs("repeating_extras", function(IDArray) { var fieldNames = []; for (var i=0; i < IDArray.length; i++) { fieldNames.push("repeating_extras_" + IDArray[i] + "_itemex"); fieldNames.push("repeating_extras_" + IDArray[i] + "_varex1"); fieldNames.push("repeating_extras_" + IDArray[i] + "_itemtut"); } var total = 0; getAttrs(fieldNames, function(values) { for (var i=0; i < IDArray.length; i++) { tac += (parseInt(values["repeating_extras_" + IDArray[i] + "_itemex"])||0) * (parseInt(values["repeating_extras_" + IDArray[i] + "_varex1"])||0) * (parseInt(values["repeating_extras_" + IDArray[i] + "_itemtut"])||0); } setAttrs({ "extratac" : tac }); }); }); }); Can anybody spot where I've gone wrong?