mate the thing is you can’t do formatting after getting spreadsheet CSV. So i have an alternative solution for this…
Use google app script
function doGet(e){
var action = e.parameter.action;
var ss=SpreadsheetApp.openByUrl("Your_Spreadsheet_URL");
var sheet = ss.getSheetByName("Sheet_Name");
if(action=="GC")
return getthe_Column(sheet);
if(action=="GR")
var cn = e.parameter.cn;
return getRow_data(cn,sheet);
}
function getthe_Column(sheet){
var lr = sheet.getLastRow();
var data = "ID";
for(var i = 2; i<=lr ; i++){
data += ","+sheet.getRange(i, 1).getValue();
}
//Logger.log(data);
return ContentService.createTextOutput(data);
}
function getRow_data(cn,sheet){
var lc = sheet.getLastColumn();
var data ="";
for(var i=1; i<=lc;i++){
if(data!=""){
data+= ","+sheet.getRange(cn, i).getValue();
}else{
data = sheet.getRange(cn, i).getValue();
}
}
return ContentService.createTextOutput(data);
}
I am not able to scroll the column field even after enabling the scrollable option. What to do bro?
Bro instead of sending index value can we send item of the column and get the row, because in listviewer I will do some filters and get the data. I have tried it, can you tell me where I went wrong?
The script I have changed
function doGet(e){
var action = e.parameter.action;
var ss=SpreadsheetApp.openByUrl(“Novartis sheet - Google Sheets”);
var sheet = ss.getSheetByName(“Sheet1”);
if(action==“GC”)
return getthe_Column(sheet);
if(action==“GR”)
var cn = e.parameter.cn;
return getRow_data(cn,sheet);
}
function getthe_Column(sheet){
var lr = sheet.getLastRow();
var data = “ID”;
for(var i = 2; i<=lr ; i++){
if(sheet.getRange(i, 10).getValue()==“Pending”)
data += “,”+sheet.getRange(i, 1).getValue();
}
return ContentService.createTextOutput(data);
}
function getRow_data(cn,sheet){
var lc = sheet.getLastColumn();
var data ="";
var r;
for(var i=1;i<=lc;i++){
if(sheet.getRange(i,1).getValue()==cn){
r=i;
break;
}
}
for(var i=1; i<=lc;i++){
if(data!=""){
data+= “,”+sheet.getRange(r, i).getValue();
}else{
data = sheet.getRange(r, i).getValue();
}
}
return ContentService.createTextOutput(data);
}
the cn in the parameter is the row number not the column number.
If you want to get the row with any value instead of index you have to define a specific column name and then sersch this row[value/parameter] in that column and get the row no. from there you can retunrn the entire row in CSV format.
set the response to text_input instead of using globle var, i’m still not getting the point of using that g-var there!! can you tell me the what eactly you are trying to do?
Bro I will show the particular column by filtering in listviewer, after selecting that particular row should be displayed.
If I give the response directly to text input, the output is correct, but if I give it to global variable the values are changing(it has listviewer values).
Here I am used the global variable to separate the values received and show in separate field.
Okay so all you are willing to do is call the row can then display the data of column in different different text inputs… right? if possible then send your project via PM
I have provided a working sample on the forum which will read/write a Google Sheet, but I do not have time to support it. Did you search before posting?