background
I followed this tutorial which basically makes a button call a google sheets script like this
function jumpToDetail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("details");
ss.setActiveSheet(sheet).setActiveSelection("A2");
}
that makes you jump to a specific cell. I looked at the google sheets docs but couldn't figure out how to make this function reference the cell it was called from
question
How do I make a function in google sheets reference the function it was called from. For example I would like the final code to look something like this:
function jumpToDetail(clickedCell) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("details");
// get the value of "id" of the same row the cell was clicked in
ss.setActiveSheet(sheet).setActiveSelection(function_of(id));
}