AliKhanafer
AliKhanafer

Reputation: 11

Google Script returning error at Line 14 but There is no code at Line 14

I am trying to write a scrip that will allow me to create a Google Sheet from an Android application, but my Google Script keeps returning this error.

error

Here is my script

1 var ss = SpreadsheetApp.openByUrl("My SpreadSheet");
2
3 var sheet = ss.getSheetByName('Items'); // be very careful ... it is 
4 the sheet name .. so it should match 
5
6
7 function doPost(e){
8 var action = e.parameter.action;
9
10 if(action == 'addItem'){
11    return addItem(e);
12
13  }
14  }
15 function addItem(e){
16
17 var date =  new Date();
18
19 var id  =  "Item"+sheet.getLastRow(); // Item1
20
21 var itemName = e.parameter.itemName;
22
23 var brand = e.parameter.brand;
24
25 sheet.appendRow([date,id,itemName,brand]);
26
27 return  
    ContentService.createTextOutput("Success").setMimeType(ContentService.MimeType.TEXT);    
29 }

Upvotes: 0

Views: 154

Answers (1)

AliKhanafer
AliKhanafer

Reputation: 11

I was using the Volley 1.0.0 library and it turned out that 1.0.0 is no longer supported so I just had to change versions to the latest Volley version and it worked

Upvotes: 1

Related Questions