Can data retrieval be customized to show only specific columns based on preferences, such as 1, 5, 8, 11, and 23?
function enterRepName(){
var ui = SpreadsheetApp.getUi();
var input = ui.prompt("Please enter your rep name.",ui.ButtonSet.OK_CANCEL);
if(input.getSelectedButton() == ui.Button.OK){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ws = ss.getSheetByName("Monitoring (Database)");
var data = ws.getRange("A2:X" + ws.getLastRow()).getValues();
var userSelectedRep = input.getResponseText();
var filteredData = data.filter(function(row){ return row[23] == userSelectedRep});
var newWs = ss.insertSheet(userSelectedRep);
newWs.getRange(2, 1, newData.length, newData[0].length).setValues(filteredData);
}
I attempted using getRangeList without success. Unsure of feasibility, I'm a beginner experimenting with scripts in Google Sheets.