I try to create an simple barcode scanner app to maintain the hardware inventory system, how ever, averythings seen okay but program not able to send data to my linked google sheet, i not sure what happen, the google sheet is share to everyone and also the app script to deploy to anymore. I not sure what else I can change for solve this issue to post data to the google sheet.
block:
google app sheet:
function doGet(e){
post_value(e);
}
//Recieve parameter and pass it to function to handle
function post_value(request){
//Edit this link to your google sheets
const ss=SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1mpOBqUTjP44Upb4ebstTXzRLrsE0VD05-o4T_iNEPFc/edit#gid=0");
const sheet = ss.getSheetByName("barcode");
const d = new Date();
const currentTimeArray = d.toLocaleString().split(", ");
const date = currentTimeArray[0]
const time = currentTimeArray[1]
const barcode = request.parameter.barcode;
const country = request.parameter.country;
sheet.appendRow([date,time,barcode,country]);
result = JSON.stringify({
"result": "OK"
});
return ContentService
.createTextOutput("(" + result + ")")
.setMimeType(ContentService.MimeType.JAVASCRIPT);
}
created google sheet: