I\'m writing a script for Google Spreadsheets, I want to have my headers index available globally throughout the script.
According to the theory, I should be able to def
I've found a solution I believe, but I'm not sure it is the "proper" way to do this.
I'm simply defining the global variable above in the script:
headerNameIndex = SpreadsheetApp.getActiveSheet().getDataRange().getValues()[0].indexOf("First-Last")
Which seems to work.
I had wrongly assumed it would only work if it was defined in the onOpen()
function.