Cannot parse text argument

Like this you mean ? Still missing something ;((((

Here is the script which I'm using:

Look how I interposed a new global variable BEFORE trying to do csv conversion, not AFTER in this sample from the demo I posted today ...

If the CSV conversion fails, I have the global legislators_CSV available for inspection via Do It.

It's like eating salad. You check for bugs before you put it in your mouth.

still missing ;(((

I guess I found the bug but don't know how to fix, please help!


This is why

You make a POST request then you make a GET request - you do not need the GET

1 Like

Thank you @TIMAI2! yes ,you was right.
now I've have only 1 issue, please help!

As we keep telling you, check your responseContent to see why it is not a properly formed csv table, it is quite possibly just a row ?

Actaully I'm new with app inventor , I'm doing my best I coudn't find solution that's I'm here
I guess it's a Web app bug. Don't you think?

Drag in a label at the top of your screen
Set the label text to responseContent in your blocks, just above where you set it to the global stock_list

Run the call

What do you see in the label?

1. Drag in a label at the top of your screen

2.Set the label text to responseContent in your blocks, just above where you set it to the global stock_list
image

3.What do you see in the label?

Can you translate that last part of the error message before </body> ?

The responseContent you received is obviously not a csv table, maybe you have problems in your script.

Show your script for action edit_stock and what you are sending in the posttext.

function doPost(e) { 
  var ss = SpreadsheetApp.openByUrl(e.parameter.File);
  var sheet = ss.getSheetByName(e.parameter.Sheet);

  ActionsFichier(e,sheet);

}

  
function ActionsFichier(e,sheet) {
  
  //lock sheet to prevent concurrent changes  
  var lock = LockService.getPublicLock();
  lock.waitLock(5000);  
  
  
  // ADD TO TRUCK_SSHEET
  if (e.parameter.Action=="Add_Truck") {
    var item = e.parameter.Item ;
    var box = e.parameter.Box ;
    
    sheet.appendRow([item,box]);
    
   return ContentService.createTextOutput("Success");
  
}

  //EDIT TO STOCK_SSHEET
     if (e.parameter.Action == "Edit_Stock") { 
     var data = [ [ e.parameter.Item, e.parameter.Box]]; 
     sheet.getRange("A"+(parseInt(e.parameter.id)+1)+":B"+(parseInt(e.parameter.id)+1)).setValues(data); 
     return ContentService.createTextOutput("Success");
   }
    
  lock.releaseLock();
}

Sorry still I'm seeing error ;((((

Is a string, not a csv table....

what should I do?

Either change the value you want to return in the script, or stop trying to set a string to a list in the blocks.

Also, I am not sure this is correct:

 var data = [ [ e.parameter.Item, e.parameter.Box]]; 

try

 var data = [e.parameter.Item, e.parameter.Box];