How do you make a list from data coming from the Extension Google Sheets for AppInventor ReadRange

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.

This community discussion shows one way to convert a json to a csv. It might be helpful.

You know how to make a List from a csv.

The extension provides the following block to convert to an AI2 list

image

SteveJG

Thank you, and I seen that but to me the response App Inventor gave did not look like a lot of examples I seen on the internet about JSON files and I did come across that same discussion.

TIMAI2
THANK YOU! I seen that block but did not know what useDefault meant and did not even cross my mind that it meant True or False.
I changed useDefault to False and nothing different happened. What does it mean?

My extension builder (IDE) required the useDefault clause for some reason. true is the best option.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.