This code removes the duplicate in the column name called "Receipt Number"
How to modify this code if the conditions matches to two column as duplicate. (i.e. Receipt Number Column and Mobile Number Column should be duplicate at the same time)
function removeDuplicates() {
var ss=SpreadsheetApp.getActive();
var sh=ss.getSheetByName("Records");
var vA=sh.getDataRange().getValues();
var hA=vA[0];
var hObj={};
hA.forEach(function(e,i){hObj[e]=i;});//header title to index
var uA=[];
var d=0;
for(var i=0;i<vA.length;i++) {
if(uA.indexOf(vA[i][hObj['Receipt Number']])==-1) {
uA.push(vA[i][hObj['Receipt Number']]);
}else{
sh.deleteRow(i+1-d++);
}
}
}
Thanks in advance.