为了账号安全,请及时绑定邮箱和手机立即绑定

将表单数据收集到 Google 表格时遇到更多麻烦

将表单数据收集到 Google 表格时遇到更多麻烦

蝴蝶不菲 2021-11-12 16:09:08
我有一个运行良好的脚本,我上次尝试它时运行良好,尽管从那以后我向它添加了一些东西并使它成为一个多页表单。代码似乎收集数据,但似乎没有将其传输到谷歌表。自从上次这样工作以来,我没有更改过输入的名称。Code.gs:function doGet() {  return HtmlService      .createTemplateFromFile('jSignature')      .evaluate();}function saveImage(bytes, sign){  var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('FormResponse');  var dateObj = Date.now();  var bytes = bytes.split(",")  var blob = Utilities.newBlob(Utilities.base64Decode(bytes[1]), 'image/png');  var fileName = blob.setName("Signature "+dateObj).getName();  var sigFolder = DriveApp.getFolderById("my folder"); //replace with your folder id  var url = sigFolder.createFile(blob).getId();  Logger.log(url)  var carrier = sign.carrier;  var address = sign.address;  var dname = sign.dname;  var dnum = sign.dnum;  var date = sign.date;  var time = sign.time;  var tractortruck = sign.tractortruck;  var odom = sign.odom;  var aircompressor = sign.aircompressor;  var airlines = sign.airlines;  var BeltsandHoses = sign.BeltsandHoses;  var Body = sign.Body;  var BrakeAccessories = sign.BrakeAccessories;  var BrakesParking = sign.BrakesParking;  var BrakesService = sign.BrakesService;  var Clutch = sign.Clutch;  var CouplingDevices = sign.CouplingDevices;  var DefrosterHeater = sign.DefrosterHeater;  var DriveLine = sign.DriveLine;  var Engine = sign.Engine;  var Exhaust = sign.Exhaust;  var FifthWheel = sign.FifthWheel;  var FluidLevels = sign.FluidLevels;  var FrameandAssembly = sign.FrameandAssembly;  var FrontAxle = sign.FrontAxle;  var FuelTanks = sign.FuelTanks;  var Horn = sign.Horn;  var Lights = sign.Lights;  var Mirrors = sign.Mirrors;  var Muffler = sign.Muffler;  var OilPressure = sign.OilPressure;  var Radiator = sign.Radiator;  var RearEnd = sign.RearEnd;  var Reflectors = sign.Reflectors;  var SafetyEquipment = sign.SafetyEquipment;  var Starter = sign.Starter;  var Steering = sign.Steering;  var SuspensionSystem = sign.SuspensionSystem;  var TireChains = sign.TireChains;  var Tires = sign.Tires;}
查看完整描述

1 回答

?
月关宝盒

TA贡献1772条经验 获得超5个赞

您从表单中检索了 47 个值,但您的范围ss.getRange(ss.getLastRow()+1, 2, 1, 48)的宽度为 48。

这就是未将值设置到电子表格中的原因。您需要做的就是将代码修改为ss.getRange(ss.getLastRow()+1, 2, 1, 47)

此外,请记住,您在landscapeCheck();内调用了该函数function showTab(n),但该函数并未在您的代码中的任何位置定义。


查看完整回答
反对 回复 2021-11-12
  • 1 回答
  • 0 关注
  • 155 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信