ReferenceError: sheet_name is not defined

This is some old code we use and I didn't create it (really novice) and now when I try to add more info in the sheets like adding other sheet names it stopped working. I hope some one can help me, everytime I get:

ReferenceError: sheet_name is not defined (anonymous) @

I have 3 spreadsheets, 1 insheet and 2 outsheets. The insheet is connected to forms, in this sheet I have the script. When people fill in the form I want the script to automatically replace the information based on a basic True or False. True going to 1 outsheet and False going to the other outsheet. After this the line should be deleted in the insheet.

  function test_onFormSubmit() {
  var dataRange = SpreadsheetApp.getActiveSpreSheet().getDataRange();
  var data = dataRange.getValues();
  var headers = data[0];
  var sheet_name = inSheet.getName();
  for (var row=3; row < data.length; row++) {
    var e = {};
    e.values = data[row].filter(Boolean); 
    e.range = dataRange.offset(row,0,1,data[0].length);
    e.namedValues = {};
    for (var col=0; col<headers.length; col++) {
      e.namedValues[headers[col]] = [data[row][col]];
    // Pass the simulated event to onFormSubmit

function Tracker(e) {

  var date = new Date();  
  var inSheet = e.range.getSheet();
  var sheet_name = inSheet.getName(); 
  var testColumn = 70;
  var firstRow = 3; 

    var outSheet = SpreadsheetApp.openById("1XBhmtWmVSI3awTYyibFpRJ92o9hAA1AyMsnA1XIFkj2").getSheetName(sheet_name);
    var outSheet2 = SpreadsheetApp.openById("16MTuClf4KqRcti0arhlYd_NdIVh_DxCpEdTJTiGchf4").getSheetName(sheet_name);
    numCols = inSheet.getLastColumn(); 
    numRows = inSheet.getLastRow();
    Logger.log("Rows : %s cols : %s",numRows,numCols); 
      for ( i=numRows; i>=firstRow; i--){
      if (inSheet.getRange(i,testColumn,1,1).getValue()=="Yes") {
          Logger.log("!!!! Found !!! Moving line : %s",i);
          //inSheet.getRange(i,1,1,numCols).clear({contentsOnly: true});
      if (inSheet.getRange(i,testColumn,1,1).getValue()=="No") {
          Logger.log("!!!! Found !!! Moving line : %s",i);
          inSheet.getRange(i,1,1,numCols).clear({contentsOnly: true});
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum