theapache64 / retrosheet

📃 Turn Google Spreadsheet to JSON endpoint (for Android and JVM) for FREE (100%)
Apache License 2.0
845 stars 39 forks source link

Edit and delete records #23

Open mddanishansari opened 2 years ago

mddanishansari commented 2 years ago

Is it possible to edit and delete records from a sheet with retrosheet?

Google forms support editing response after submission (must be enabled in setting first), so editing might be possible. But I have no idea about deleting records.

@theapache64 have you given any thought on this?

theapache64 commented 2 years ago

Yeah. Editing should be possible. AFAIK, there's no way you can delete a response, but soft delete should be manageable with a boolean flag.

Editing is something that I was planning to implement. Thanks for bringing this into notice

M4NN3 commented 1 year ago

Any updates on this? Is it possible to edit a response?

mddanishansari commented 1 year ago

I tried to have a look at the edit feature and did some research.

So this is currently how it can be done using Postman. When the form is submitted, in the HTML response we get an edit link which is in this format https://{GOOGLE_FORM_URL}/viewform?usp=form_confirm&edit2={EDIT_ID} EDIT_ID is important here

Now we can use that edit URL (after removing usp=form_confirm) and request it (just like writing new data) and it'll update the data.

Now the problem is that, we get the EDIT_ID only once, so in order to update data in future, we need to store EDIT_ID somewhere, which is definitely not a good idea.

Another thing I thought which might help is Google's query language but unfortunately they do not support modifying data yet.

Thoughts on this? @theapache64

theapache64 commented 1 year ago

@mddanishansari This is great information. Let me look into this after work hours :). Will keep you posted