I have this function that check duplicate rows data on a sheet, and remove it. But i need it to check only the first column and use it to remove the entire row. What i have to change?
function removerDuplicata() {
var sheet = SpreadsheetApp.getActiveSheet();
var intervalo = sheet.getRange("A2:H")
var data = intervalo.getValues();
var novaData = new Array();
for(i in data){
var row = data[i];
var duplicata = false;
for(j in novaData){
if(row.join() == novaData[j].join()){
duplicata = true;
}
}
if(!duplicata){
novaData.push(row);
}
}
intervalo.clearContent();
sheet.getRange(2, 1, novaData.length,
novaData[0].length).setValues(novaData);
}