I'm having an issue with my Google (Apps) Script that is connected to a Google Spreadsheet.
Every part of the script works perfectly, except for one line:
headers[0] = headers[0] + ":";
If I remove this line, the script runs smoothly. But adding it causes the script to fail.
I've initialized the array beforehand in the following way.
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
I am trying to figure out what's causing the issue with element assignment and how to resolve it.
Any assistance would be greatly appreciated.