Search code examples
javascripthtmlgoogle-drive-apigoogle-docs-api

form with post method to google spreadsheet not working anymore


Suddenly this form to post directly to a public Spreadsheet has stopped:

<form action='https://drive.google.com/spreadsheet/formResponse?formkey=XXXXXXXXXXXXXXXX' method='post'>
<input type='text' name='entry.0.single' />
<input type='text' name='entry.1.single' />
[...]
</form>

I managed to do it through the Form associated to the Spreadsheet:

<form action='https://docs.google.com/forms/d/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/formResponse' method='post'>
<input type='text' name='entry.YYYYYYYYYYY' />
<input type='text' name='entry.ZZZZZZZZZZZ' />
[...]
</form>

The problem is: the input name is different for each form, in contrast to the old way to do it, that it was entry.0, entry.1 etc. Is there any workaround for this ?


Solution

  • I recall reading somewhere that G doesn't like third party apps bypassing the Form in order to post directly to the spreadsheet. You might need to write a simple Apps Script or App Engine servlet to get a robust alternative.