I just started to learn Apps Script and I need to add some text to each value of an array. This code just puts the values in another column:
function getData() {
var sheet1 = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName("Stocks");
var symbol = sheet1.getRange('A1:A7').getValues();
sheet1.getRange('C1:C7').setValues(symbol);
}
I want to add some text to the output, 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 + ")'
);
}
But I know that this won't work. How do I add to each value being written?