title: Reduce the runtime/execeution on import function for Googlesheets and GoogleApps Script
body: <p>Currently have a script that pulls CSV files from google drive from a cell reference.  Just wondering if there's a way to reduce the runtime.  Currently the script takes about 45 -60 seconds to finish running.  Any help would be appreciated or completely alternative way to get a faster response in such where when I change the cell references my data gets pulled faster.</p>
  <pre><code>function importCSV() {
    const ss = SpreadsheetApp.getActive();
    const id = ss.getSheetByName(&quot;Dashboard&quot;).getRange(&quot;A2&quot;).getValue();
    const folder = DriveApp.getFolderById(id);
    const name = ss.getSheetByName(&quot;Dashboard&quot;).getRange(&quot;B2&quot;).getValue();
    const name2 = ss.getSheetByName(&quot;Dashboard&quot;).getRange(&quot;C2&quot;).getValue();
    const file = folder.getFilesByName(name).next();
    const file2 = folder.getFilesByName(name2).next();
    const csvData = Utilities.parseCsv(file.getBlob().getDataAsString());
    const csvData2 = Utilities.parseCsv(file2.getBlob().getDataAsString());
    
    const target = ss.getSheetByName(&quot;Input&quot;);
    const target2 = ss.getSheetByName(&quot;Input2&quot;);
  
    target.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
    target2.getRange(1, 1, csvData2.length, csvData2[0].length).setValues(csvData2);
  }
  </code></pre>