I have a script that moves rows based on a specific value in a column, but I am looking to only transfer certain columns within those rows.
This is the current script I am using:
//Script to move rows from Form tab to Des tab
function moveSafeRows()
{
var ss=SpreadsheetApp.getActive();
var sh0=ss.getSheetByName('Form');
var rg0=sh0.getDataRange();
var sh1=ss.getSheetByName('Des');
var vals=rg0.getValues();
for(var i=vals.length-1;i>0;i--)
{
if(vals[i][3]=='Yes')
{
sh1.appendRow([vals[i][0], vals[i][1], vals[i][4]]);
sh0.deleteRow(i+1);
}
}
}
Although there are 8 columns in the Form tab, I would like to only transfer values from columns 1, 2, and 5.
I have included a link to a sample spreadsheet that demonstrates the desired output on the second tab: https://docs.google.com/spreadsheets/d/17CRkz71FehikIblgwjHg-r982cUe95WLPI6LiFUr2LI/edit?pli=1#gid=0