sheetfu-apps-script icon indicating copy to clipboard operation
sheetfu-apps-script copied to clipboard

.commit() method breaks some formulas

Open urpizu opened this issue 7 years ago • 2 comments
trafficstars

Being a formula in a random cell: =SUM($1:$2) / =SUM($A:$B) After commit it's broken to: =SUM(R1:R2) / =SUM(C1:C2)

After some research, it's a Google Sheets API issue. While next methods are equivalent... range.setValue(=R[0]) ~= range.setFormulaR1C1(=R[0])

It looks that .setValue() can not recognize next R1C1 pattern, when .setFormulaR1C1() can: range.setValue(=R1:R2) !== range.setFormulaR1C1(=R1:R2)

I've been able to avoid the issue using the Item.commitFieldValue(field) method.

urpizu avatar Jul 24 '18 14:07 urpizu

Shall we close this issue now? Since yesterday PR, I don't think it is relevant anymore.

sp-philippe-oger avatar Jul 25 '18 08:07 sp-philippe-oger

Woop, nope! This is the only issue we didn't fix with the yesterday PR! Sheetfu keeps breaking formulas when Item.commit() or Table.commit(). I'd keep it so future users can understand and find alternatives to the issue.

urpizu avatar Jul 25 '18 08:07 urpizu