I have try to get values from specific columns from google sheet and for loop to find matching between column title name and row names so if user click on a button that have info about a movie all name of the cast in that movie will appear in a table, The code I have does that right , but there are columns that contain people's names that I don't want to show Is there a way to get the data with the same code that I have, but with specific columns that get all the data from?
My code
function getSecondData(moveId){
if(moveId == undefined)
moveId = 14;
var secondSS = SpreadsheetApp.openById(ss2);
var secondSh = secondSS.getSheetByName('Moves');
var Data = secondSh.getDataRange().getValues();
var actorName= secondSh.getRange(1,5,1,secondSh.getLastColumn()).getValues();
Data.splice(0,1);
var tmpData = [];
for(var x=0 ; x<Data.length ; x++){
if(Data[x][3] == moveId){
tmpData.push(Data[x]);
}
}
var finalData = [];
for(var x=0 ; x<tmpData.length ; x++){
for(var y=4 ; y<tmpData[x].length ; y++){
if(tmpData[x][y] != ''){
finalData[y-3] = tmpData[x][y]+'^'+tmpData[x][0];
}
}
}
return {'data':finalData,'move':moveId,'files':actorName}
}
I have tried getRangeList()
but dose not give you the value and you cant use push()
on it
Because it is not possible to explain the whole process in detail, I designed it on Figma https://www.figma.com/file/8s69QPKmWIHLrlKuDz6NyH/