Google表格未正确设置所有值

时间:2016-03-01 23:24:22

标签: google-sheets

我看到奇怪的数据,这些数据冲突对我来说毫无意义。

我有一个函数可以从表单结果中获取信息,并将其粘贴到库存数据库中。它一次粘贴一个,因为表单的排序方式与表单不同。所以我检查标题以查看粘贴数据的位置。这是我正在使用的代码块。

//sets the value of the response in the col it belongs in for each response
    for (var j = 0; j < responseTitles.length; j++) {
      Logger.log(responseTitles[j] +": "+responseItems[j]);
      Logger.log(startCol);

      startCol = getIndexOfAttribute(inventoryRange, responseTitles[j])+1
      inventorySheet.getRange(2, startCol).setValue(responseItems[j]);  
    }   

这是Logger输出:

[16-03-01 18:04:36:166 EST] Category: Access Control
[16-03-01 18:04:36:286 EST] 8.0
[16-03-01 18:04:36:288 EST] Sub Category: Some
[16-03-01 18:04:36:380 EST] 9.0
[16-03-01 18:04:36:382 EST] Short Name: Unique
[16-03-01 18:04:36:498 EST] 10.0
[16-03-01 18:04:36:502 EST] Manufacturer: Item
[16-03-01 18:04:36:595 EST] 11.0
[16-03-01 18:04:36:598 EST] Model #: With
[16-03-01 18:04:36:718 EST] 12.0
[16-03-01 18:04:36:720 EST] Operaing Voltage: A
[16-03-01 18:04:36:835 EST] 15.0
[16-03-01 18:04:36:837 EST] Colour: Firmware
[16-03-01 18:04:36:962 EST] 16.0
[16-03-01 18:04:36:964 EST] Product Documents: Serial
[16-03-01 18:04:37:112 EST] 25.0
[16-03-01 18:04:37:115 EST] Serial #: *
[16-03-01 18:04:37:210 EST] 13.0
[16-03-01 18:04:37:213 EST] Firmware Version: *
[16-03-01 18:04:37:316 EST] 14.0
[16-03-01 18:04:37:318 EST] MAC Address: *
[16-03-01 18:04:37:443 EST] 17.0
[16-03-01 18:04:37:445 EST] IP Address: *
[16-03-01 18:04:37:591 EST] 18.0
[16-03-01 18:04:37:592 EST] MAC Address 2: *
[16-03-01 18:04:37:706 EST] 19.0
[16-03-01 18:04:37:709 EST] IP Address 2: *
[16-03-01 18:04:37:840 EST] 20.0
[16-03-01 18:04:37:843 EST] RFID #: *
[16-03-01 18:04:38:167 EST] 21.0

但是工作表只显示this

1 个答案:

答案 0 :(得分:0)

测试代码时,最好不要使用带黑色文本的黑色背景。