Runtime error in the reading part

Dear all,
I made a small program that saves data to a google sheet and read it back in the app using google apps script.
When I open the app all data in google sheet is shown in my app but when I add some new data I got an error message.
image
If I then initialize the screen again he shows all the data including the new one, so I know that everything is transferred to google sheets and my app can read everything back except when I add new data. I searched a long time for a solution but couldn't find the correct one.
I show you here below my blocks I use for reading, if you need more please let me know.


Thanks in advance,
Rudi

Set global table to an empty list, not an empty text.

You do not show your relevant blocks (how you add data, google apps script, etc.)

Show the value of responseContent when you get the error

Where do you set global data to an empty list?

Dear Tim,

Set global table to an empty list, not an empty text.
image
It is an empty list or is it something else you are talking about?

You do not show your relevant blocks (how you add data, google apps script, etc.)

These are all the blocks.

And the script:
function doGet(e) {

var ss=SpreadsheetApp.openByUrl("DigitalEnergyMeter - Google Sheets");

var sheet=ss.getSheetByName("Jan");

addUser(e,sheet);

}

function doPost(e) {

var ss=SpreadsheetApp.openByUrl("DigitalEnergyMeter - Google Sheets");

var sheet=ss.getSheetByName("Jan");

addUser(e,sheet);

}

function addUser(e,sheet){

var Datum=e.parameter.Datum;

var VerbruikDag=e.parameter.VerbruikDag;

var VerbruikNacht=e.parameter.VerbruikNacht;

var OpbrengstDag=e.parameter.OpbrengstDag;

var OpbrengstNacht=e.parameter.OpbrengstNacht;

sheet.appendRow([Datum,VerbruikDag,VerbruikNacht,OpbrengstDag,OpbrengstNacht]);

}

Show the value of responseContent when you get the error
How do I do this?

Please do read following:
I'm based in Belgium, I'm trying to teach a group of 12 retired people whom are bored to sit all day in there sofa doing nothing and I'm doing this completely free of charge but I'm not a programmer, just a guy who now a little of app inventor and want to give those people a goal in there life.
So please if you need something keep this in mind and think you are talking to an newbee :grin:

Thanks in advance for your help.
Rudi

Here :slight_smile:

image

You can show responseContent in a label

It really helps to see all the various elements when dealing with google apps script and spreadsheets and apps. We have to ensure that all three are in harmony :slight_smile:

If you have a look here, you can see how you might simplify your blocks and your script.....