I'm diving into the world of Apps Script and I have a task at hand - adding some text to each value in an array. However, the code I currently have simply moves those values to another column:
function getData() {
var sheet1 = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName("Stocks");
var symbol = sheet1.getRange('A1:A7').getValues();
sheet1.getRange('C1:C7').setValues(symbol);
}
What I really want is to enhance the output by appending additional text to each value, something like this:
function getData() {
var sheet1 = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName("Stocks");
var symbol = sheet1.getRange('A1:A7').getValues();
sheet1.getRange('C1:C7').setValues(
'=GOOGLEFINANCE("FRA:' + symbol + ")'
);
}
Unfortunately, I'm aware that my current approach won't yield the desired results. How can I successfully append text to each value being written?