Currently I am using Google Sheets as a database in my app. I am aware of the usage quotas, but I am confused about which services I am using and what the limitations are. My app just passes values to Google Sheets. I would like to get some answers for the following questions:
Triggers total runtime = 90min/day
Is this the total time that the script would run in a day?URL fetch calls = 20000/day
Does it mean I can call script url 20000 per day from my app?Script runtime = 6min/execution
Please explain what this quota means
Web App code:
private void setItems() {
StringRequest stringRequest = new StringRequest(Request.Method.POST, script,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}
) {
@Override
protected Map<String, String> getParams() {
Map<String, String> parmas = new HashMap<>();
//here we pass params
parmas.put("action","addItem");
parmas.put("teamname",teamname);
parmas.put("p1",finalp1);
parmas.put("p2",finalp2);
parmas.put("p3",finalp3);
parmas.put("p4",finalp4);
parmas.put("p5",finalp5);
return parmas;
}
};
int socketTimeOut = 50000;// u can change this .. here it is 50 seconds
RetryPolicy retryPolicy = new DefaultRetryPolicy(socketTimeOut, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
stringRequest.setRetryPolicy(retryPolicy);
RequestQueue queue = Volley.newRequestQueue(JoinContest.this);
queue.add(stringRequest);
Server-side code:
var ss = SpreadsheetApp.openByUrl("MY URL");
var sheet = ss.getSheetByName('Main');
function doPost(e){
var action = e.parameter.action;
if(action == 'addItem'){
return addItem(e);
}
}
function addItem(e){
var teamname = e.parameter.teamname;
var position = sheet.getLastRow(); // Item1
var p1 = e.parameter.p1;
var p2 = e.parameter.p2;
var p3 = e.parameter.p3;
var p4 = e.parameter.p4;
var p5 = e.parameter.p5;
sheet.appendRow([position,teamname,p1,p2,p3,p4,p5]);
return ContentService.createTextOutput("Success").setMimeType(ContentService.MimeType.TEXT);
}