working version checkin

*  add config class
*  add vlookup
*  add menu
*  add photo folder creation
*  add prep for product templates
This commit is contained in:
Ben Miller
2024-11-04 20:44:19 -07:00
parent b6b75e426c
commit 20a5e738f7
7 changed files with 142 additions and 0 deletions

View File

@ -41,3 +41,28 @@ function getColumnValuesByName(
return column.getValues()
}
}
function vlookupByColumns(
sheetName: string,
searchColumn: string,
searchKey: string,
resultColumn: string
) {
let s = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName)
let searchData = getColumnValuesByName(s, searchColumn)
let dataList = searchData.map((x) => x[0])
let index = dataList.indexOf(searchKey)
if (index === -1) {
toastAndLog(searchKey + " not found")
return
}
let resultValue = getCellValueByColumnName(s, resultColumn, index + 2)
toastAndLog(resultValue)
return resultValue
}
function toastAndLog(message: string) {
SpreadsheetApp.getActive().toast(message)
console.log(message)
}