Home > Mobile >  google Apps Script Export Issues
google Apps Script Export Issues

Time:06-19

I'm having an issue with Google Apps Script. 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. The issue is that no matter what I change the getRange values to, it continues to export the entire column. 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??

CodePudding user response:

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:

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);
}

enter image description here

  • Related