0

How to JOIN 2 tables on 1 column together like in SQL "LEFT OUTER JOIN" for a Google Sheet in a simple way using Google App Script?

Found solutions, but does not solves my issue:

sogu
  • 2,738
  • 5
  • 31
  • 90
  • 1
    What is your issue? – Rubén Apr 21 '22 at 14:56
  • that this was the only actual google app script answer that is +200 lines that could have helped but it did not worked https://stackoverflow.com/a/67149921/10270590 but it did not worked and to my very specific question my 7 liner just works perfectly. – sogu Apr 21 '22 at 15:05
  • 1
    Thanks for your reply. Please bear in mind that questions should be self contained... you should include here a description of the problem to be solved, by the other hand it's not clear what you mean by "not worked"... there is no way for others to know if how you tried used the referred script. – Rubén Apr 21 '22 at 15:15

1 Answers1

0

Create a Google App Script that has embedded normal google sheet code.

  var sp = SpreadsheetApp.getActiveSheet();
  var col = [];
  for(var n=0 ; n < sp.getMaxRows(); n++){
    var hh = n + 1;
    col.push(['=VLOOKUP(A' + hh + ',sheet_to_look_up!A:C,2,false)']);
  }
  sp.getRange('L:L').setValues(col); 
  sp.getRange('L1').setValue('Column Header Name');

sogu
  • 2,738
  • 5
  • 31
  • 90