Hello!
So I am trying to read and write a single cell and a range in Google Sheets. I was able to read the cells with App Inventor without using an extension no problem. When I write to a cell in App Inventor, Apps Scripts will show doPost failed in the executions section of Apps Scrips.So, I downloaded Google Sheets for AppInventor that TIMAI2 made. It works perfectly reading and writing to Google Sheets.
My problem is when I use my code to read the sheet. It downloads as a CSV and I know how to use that as a list. When I use the extension to ReadRange, I think it downloads as a JSON.stringify and I do not know how to use that as a list.
So I don't need to use my code to read cells and the extension to write cells. Can someone teach me to make a list out of the data received from the extension or tell me why I can read cells but not write cells using my code.
The code in Apps Script:
function doPost(e) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName(e.parameters.sheet);
var rng = sh.getRange(e.parameters.range);
rng.setValue(e.parameters.newValue);
return ContentService.createTextOutput('Cell ' + e.parameters.range + ' updated');
}
function doGet(e) {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName(e.parameters.sheet);
var rng = sh.getRange(e.parameters.range);
rng.setValue(e.parameters.newValue);
return ContentService.createTextOutput('Cell ' + e.parameters.range + ' updated');
}
Keep in mind that when I send the data from App Inventor. Google Sheets knows I sent it but Status fails in the executions section of Apps Script.