简体   繁体   English

google Apps 脚本导出问题

[英]google Apps Script Export Issues

I'm having an issue with Google Apps Script.我在使用 Google Apps 脚本时遇到问题。 I've got a script that currently exports an entire column to individual txt files, however, I want to reuse this script but for only one cell.我有一个脚本,当前将一整列导出到单个 txt 文件,但是,我想重用这个脚本,但只用于一个单元格。 The issue is that no matter what I change the getRange values to, it continues to export the entire column.问题是,无论我将 getRange 值更改为什么,它都会继续导出整个列。 Below is the script:下面是脚本:

function round01Quali() {
  var ss = SpreadsheetApp.getActive();
  var sh = ss.getActiveSheet();
  var rg = sh.getRange(2, 2, 1, 2);
  var vs = rg.getValues().filter(r => r.every(Boolean));
  vs.forEach(r => DriveApp.getFolderById(deleteround01Quali('1m_-D9loocLQEJ_2AMWS1EAm3pJeFycpV', r[0])).createFile('starting-grid.svg', r[1]));
}

Can anyone pinpoint what I'm doing wrong??谁能指出我做错了什么?

By making a slight modification to your code and running on apps script to check the value being provided from one single cell, for example E1 should give me an IP:通过对您的代码进行轻微修改并在应用程序脚本上运行以检查从单个单元格提供的值,例如 E1 应该给我一个 IP:

 function round01Quali() { var ss = SpreadsheetApp.getActive(); var sh = ss.getActiveSheet(); var rg = sh.getRange("E2").getValues(); //var vs = rg.getValues().filter(r => r.every(Boolean)); //vs.forEach(r => DriveApp.getFolderById(deleteround01Quali('1m_-D9loocLQEJ_2AMWS1EAm3pJeFycpV', r[0])).createFile('starting-grid.svg', r[1])); Logger.log (rg); }

Sheet example with the IP the response from the log is: 带有IP 的工作表示例,来自日志的响应是: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM