Trying to fix this bug for days

Hey all,

I had an earlier forum post on this, but it kinda got left in the dust. I’m having an issue with a personal project that I am determined on finishing, but have a few last bugs with async functions. I know these come as the usual trials and tribulations of being a programmer, but for whatever reason, Promises and Async functions always get the best of me. I thought I made some code, that really worked, but when I res.json the javascript objects, the show up empty.

EDIT: I FINALLY FIXED IT


    var rowersOptions = {
      'min-row': 4,
      'max-row': maxRows, //Defined earlier
      'min-col': 2,
      'max-col': 2,
      'return-empty': true
    };
    var rowers = [];
   //Get Rowers
    sheet.getCells(rowersOptions, function(err, cells) {
      var CellData = {};
      for (var i = 0; i<cells.length; i++) {
        rowers.push(cells[i].value);
      }
    });


      var date = "6/18" //NEED TO CHANGE DATE TO REAL DATE

      function getWomen (col) {
        var columnOptions1 = {
          'min-row': 4,
          'max-row': maxRows,
          'min-col': col,
          'max-col': col,
          'return-empty': true
        };
        return new Promise(function(resolve, reject) {
          sheet.getCells(columnOptions1, function(err, cells) {
            for (var i = 0; i<cells.length; i++) {
              var name = rowers[i];
              if (cells[i].value === "1") {
                finalComingWomen[name] = "YES"; //JSON Object defined earlier
              } else if (cells[i].value === "0") {
                finalComingWomen[name] = "NO";
              } else {
                finalComingWomen[name] = "N/A";
              }
              if (i == cells.length - 1) {
                resolve();
              }
            }
          });
        });
      }


      function getOpen (col) {
        var columnOptions2 = {
          'min-row': 4,
          'max-row': maxRows,
          'min-col': col+1,
          'max-col': col+1,
          'return-empty': true
        };
        return new Promise(function(resolve, reject) {
          sheet.getCells(columnOptions2, function(err, cells) {
            for (var i = 0; i<cells.length; i++) {
              var name = rowers[i];
              if (cells[i].value === "1") {
                finalComingOpen[name] = "YES"; //JSON Object defined earlier
              } else if (cells[i].value === "0") {
                finalComingOpen[name] = "NO";
              } else {
                finalComingOpen[name] = "N/A";
              }
              if (i == cells.length - 1) {
                resolve();
              }
            }
          });
        });
      }


      //Finding Column Applicable for each data set, and then grabbing data from Google Sheets API with the column number
      var dateOptions = {
        'min-row': 2,
        'max-row': 2,
        'return-empty': true
      };
      sheet.getCells(dateOptions, function(err, cells) {
        for (var i = 0; i<cells.length; i++) {
          if (date == cells[i].value){
          getWomen(Number(cells[i].col));
          getOpen(Number(cells[i].col));
          Promise.all([getWomen, getOpen]).then(() => {
            res.json({finalComingOpen, finalComingWomen});
          });
          break;
          }
        }
      });