我正在使用getRowsData
检索信息,但我想修改存储在 JS 对象中的值,然后将修改后的值写回单元格。我想使用创建的规范化标头变量getRowsData
写回单元格。所以如果我使用检索信息
var thirdEmployee = employeeObjects[2];
var stringToDisplay = "The third column is: " + thirdEmployee.firstName + " " + thirdEmployee.lastName;
stringToDisplay += " (id #" + thirdEmployee.employeeId + ") working in the ";
stringToDisplay += thirdEmployee.department + " department and with phone number ";
stringToDisplay += thirdEmployee.phoneNumber;
ss.msgBox(stringToDisplay);
然后,例如,我会为 Javascript 对象分配一个新值thirdEmployee.phoneNumber;
,然后将其写入范围内的正确位置(即,活动行、基于标题的列#)。
thirdEmployee.phoneNumber = "123-555-5555";
thirdEmployee.phoneNumber.setNewValue();
or
setNewValue.thirdEmployee.phoneNumber;
基本上,这将是一个修改版本,setRowsData
但允许修改一个对象,然后根据基于标题的活动行和列将该对象写入电子表格。
任何人都使用或知道如何做到这一点?