I am going to suggest that you try out my GSConnected extension
This will handle data uploads to the sheet, and data downloads, along with updates and deletions
Follow the instructions carefully and you should have a fully working Create/Read/Update/Delete setup for your app.
This will be much better than trying to work with a poorly put together script method by "others...."