使用新的应用程序脚本,该脚本是根据基于sheet2cal的工作应用程序脚本构建的。有效,但当结果转移到日历时不断得到 NaN。
if (eventID != complete) {
var currentCell = sheet.getRange(startRow + i, numColumns);
calendar.createEvent(Purpose + '-' + Visiting, Start, End, { description: +Name + ' | ' + Phone + ' | ' + Email + ' | ' + Details + ' | ' + Insurance });
currentCell.setValue(complete);
}
日历结果:
Contractor-Ron Layton
Saturday, September 30⋅1:00 – 6:00pm
**NaN** | 9042701111 | [email protected] | Kia Soul, FL-SUX000, Sales pitch |
当我看到你的展示脚本时,似乎是
{ description: +Name + ' | ' + Phone + ' | ' + Email + ' | ' + Details + ' | ' + Insurance }
。在这种情况下,我认为您当前问题的原因是由于 +
的 +Name
。因此,请按如下方式删除此+
。
calendar.createEvent(Purpose + '-' + Visiting, Start, End, { description: +Name + ' | ' + Phone + ' | ' + Email + ' | ' + Details + ' | ' + Insurance });
calendar.createEvent(Purpose + '-' + Visiting, Start, End, { description: Name + ' | ' + Phone + ' | ' + Email + ' | ' + Details + ' | ' + Insurance });