Help to store the colintree list in gsheet & retrive back

as i said, scripturl will be a better chocie

Please me with that only

Do you use any apps script in this? If so pls share with ne let me modify

Yes dear i use a app script
Spreadsheet_Extension_Script (6).txt (2.5 KB)

will it be possible if i will use different column to store like product image , product name … etc and when i will call the row then we can set it back

Yes, like that only i will suggest. I tried the same from myside and got succeeded

Then please share me

Hey dear @Still-learning, any update ?

I am in hospital, pls wait. Let you know soon.

Oh, I’m so sorry to hear that! Wishing you a speedy recovery. Take your time, no rush at all. Hope you feel better soon!

So, i have made three column for storing the colintreelistview in gsheet , hopefully now we can store the data and when recall the list we can Reconstruct the ColinTreeListView with the retrieved list.

Screenshot 2025-04-03 233452

try this script code in your apps script, this wont affect your existing code…

function doGet(e) {
  return ManageSheet(e);
}
function doPost(e) {
  return ManageSheet(e);
}

function ManageSheet(e) {
  
  if (e.parameter.func == "ReadAll") {
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1]; 
    var rg = sh.getDataRange().getValues(); 
    var outString = '';
      for(var row=0 ; row<rg.length ; ++row){
        outString += rg[row].join(',') + '\n';  
      } 
    return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
  } 
  else if (e.parameter.func == "Delete") {
    var record = e.parameter.id;
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
    sh.deleteRow(parseInt(record) + 1);  
    return ContentService.createTextOutput("true");  
  } 
  else if (e.parameter.func == "ReadRecord") {
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
    var rg = sh.getDataRange().getValues();
    var outString = '';
    outString += rg[parseInt(e.parameter.id)].join('**');
    return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
  }   
  else if (e.parameter.func == "UpdateSP") { 
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
    var data = [ [ e.parameter.UpdateRecord ] ]; 
     sh.getRange((e.parameter.CN)+(parseInt(e.parameter.id)+1)).setValues(data); 
    return ContentService.createTextOutput("true");
  }
  else if (e.parameter.func == "appendRow") {
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
    
    try {
      // Parse the JSON data
      var data = JSON.parse(e.parameter.DATA);
      
      // Check if data is a 2D array (list of lists)
      if (Array.isArray(data) && data.length > 0 && Array.isArray(data[0])) {
        // Get the last row
        var lastRow = sh.getLastRow();
        
        // Append all rows at once for better performance
        sh.getRange(lastRow + 1, 1, data.length, data[0].length).setValues(data);
        
        return ContentService.createTextOutput("Successfully added " + data.length + " rows")
          .setMimeType(ContentService.MimeType.TEXT);
      } else {
        throw new Error("Invalid data format - expected 2D array");
      }
    } catch (error) {
      return ContentService.createTextOutput("Error: " + error.message)
        .setMimeType(ContentService.MimeType.TEXT);
    }
  }
 
  else if (e.parameter.func == "Create") {
    var ss = SpreadsheetApp.getActive();
    var sh = ss.getSheets()[parseInt(e.parameter.SN)-1];
    
    var data =[e.parameter.A, e.parameter.B, e.parameter.C, e.parameter.D, e.parameter.E, e.parameter.F, e.parameter.G, e.parameter.H, e.parameter.I, e.parameter.J, e.parameter.K, e.parameter.L, e.parameter.M, e.parameter.N, e.parameter.O, e.parameter.P,e.parameter.Q, e.parameter.R, e.parameter.S, e.parameter.T, e.parameter.U, e.parameter.V, e.parameter.W, e.parameter.X, e.parameter.Y, e.parameter.Z]; 
    
    sh.appendRow(data);
    
    return ContentService.createTextOutput(data);
  }
}

COLINTREE_LIST.aia (94.0 KB)

I AM TRYING MY BEST BUT WHEN I AM TRYING TO STORE / appendRow ITS not working

Did you add the same apps script? deployed it? changed the new url into the app? beterr try the aia and see it in this gsheet, what and all you try it is adding in my ghseet which says you have not deployed my scripts

i have depolyed your script and got the url and made the new request url for appendrow and qurey but still no responce could you please once check the script

after second button click, click on this block , click do it then check the GET request url

sorry but didn’t what you want to say

connect in companion
click button1
click button 2
after few seconds, do this and check the url

SORRY, I ALSO DID A MISTAKE I THINK


I SET IT ONLY MYSELF

No , this is your script url and when i check the above url i got success notification only… see the previous post