Web link to Google Sheet fails in my app

I want a user of my app to be able to send data to a Google sheet of mine to record user experience.

I have included a Web component and tested code using it in a test app which is executed in the
screen initialisation block.

I have set up a Google Sheet and copied its link generated when the sheet app is deployed, with permission for anyone to access it.

I have copied the link into an app variable and used it in a Web component to post comma
separated values to the GoogleSheet.

On starting the test app, after a couple of seconds, I see the CSV values appear in
the first row columns ok.

On reloading the app, the same values appear again, but in the next row, as expected.

My problem is, when I copy and use the same test code in my main, much larger app, I get no values
appearing in the Google spreadsheet from the screen initialisation block, which is where the test code is entered.

How can this be? Both test and main apps are Appinventor apps.

Thanks in advance
Tony

We need to see three things:

  • your apps script ( I will assume you have deployed your web app correctly)
  • your google sheet
  • your appinventor blocks

Also, from your description, it doesn't sound like you're using the Google Sheets component in the Storage bin, which can fix out a lot of reading and writing issues:
image

hi.
The app script is standard boilerplate DoPost and DoGet script generated automatically.
by selecting Extensions...App Script from the Googlesheet menu. I will not post it here.
Note that I post stuff on screen initialisation, and also by button selection,
so both types show up on the google sheet.
Blocks

Sheet

App screen

The 'Screen initialisation' stuff I include in my much larger app, and it does not produce output to the same google sheet.
Note that the link for the postandgetdata sheet was made current for this test.
Only one of the sheets was active for this test.
Nothing shows up when I use the same 'On screen initialisation' code in my main app.
I double checked that the sheet links are valid for all tests.

Thankyou, I will give that a go.

Up to you, limits the help I can/will give.

This is not a good idea:

image

You should send one request, then when you receive a response, send the second request.