daily pastebin goal
29%
SHARE
TWEET

Pyrgos - importNotes

RUZBE Feb 17th, 2019 (edited) 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function importNotes() {
  2.   try {
  3.     var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  4.     var meetingNotes = spreadsheet.getSheetByName("Meeting Notes");
  5.     var interpol = SpreadsheetApp.openById("1KmZy7n1xM9iB1kpxTgAYjtgwjalC4-UDW1vXZ09YyRI").getSheetByName("Pyrgos");
  6.     var sheet = interpol.getDataRange().getValues();
  7.     var noteStart = [];
  8.     for (var i = 1; i < sheet.length; i++) {
  9.       if (sheet[i][1] == "Meeting Notes") {
  10.         noteStart.push(i);
  11.       }
  12.     }
  13.     var noteStart = noteStart[0] + 2;
  14.     var noteEnd = noteStart + 12;
  15.     var a = 9;
  16.     for (var u = noteStart; u < noteEnd; u++) {
  17.       var notes = interpol.getRange(u, 2).getValue();
  18.       meetingNotes.getRange(a, 4).setValue(notes);
  19.       a++
  20.     }
  21.   } catch (error) {
  22.     throw new Error("Only C/INSP+ can add notes");
  23.   }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top