In my Event Scheduler spreadsheet, I am looking for a way to efficiently manage adding or removing employees from the query table in column A. Currently, I have a dropdown list in each row to select names and a script that can only replace one name at a time on the database sheet upon clicking a button. However, this method is not practical when needing to update multiple names simultaneously. Is there a way to modify the function so it can replace multiple names at once instead of just one? Any assistance would be greatly appreciated. Below is the code snippet I currently have for replacing a single value.
function saveRecord7() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const formWS = ss.getSheetByName('Dashboard')
const dataWS = ss.getSheetByName('Static_VDatabase_UID')
const idCell = formWS.getRange('G7')
const fieldRange =["AB7"]
const clearcell = formWS.getRange('AB7')
const id = idCell.getValue()
if(id== ''){
return
}
const cellFound = dataWS.getRange("A:A")
.createTextFinder(id)
.matchCase(true)
.matchEntireCell(true)
.findNext()
if(!cellFound) return
const row = cellFound.getRow()
const fieldValues = fieldRange.map(f => formWS.getRange(f).getValue())
fieldValues.unshift()
dataWS.getRange(row,20,1,fieldValues.length).setValues([fieldValues])
clearcell.clearContent();
}