Error 400 Bad Request "failed_precondition" on Collect to Google sheets

1. What is the problem? Be very detailed.
I'm trying to push this form to this sheet on google sheets. The sheet works fine, the form creation is without incident, filling the data is fine, but upon submission, I get this error:

image

2. What app or server are you using and on what device and operating system? Include version numbers.

Using ODK Collect 1.21.2 on my Google Pixel

3. What you have you tried to fix the problem?

I have tried recreating the xml form, loading a survey with NO data (in case it's a field problem), and with tons of data, Same error message on each. I also tried deleting both the spreadsheet and the form, creating new versions of each and uploading fresh from start, same error everytime.

I have made permissions to both files fully open in case it's a permissions issue.

I have also tried deleting all the field headings in the results tab in case there was a problem with the actual saving to the sheet... all to no avail.

4. What steps can we take to reproduce the problem?

As mentioned above, error is the same in all instances. Any submission from the xml mentioned above to that google spreadsheet gives the same error.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

I do successfully upload to google sheets spreadsheets from this version of Collect on a regular basis, so there's something wrong with this specific form... just can't figure out what from the error.

@Grzesiek2010 Can you help here?

I got the same error when I tried to send data to your sheet but everything is fine if I create my own one.
@Amit_Kohli
I think you just copied the link visible in your browser because it ends with: edit#gid=773120038
https://docs.google.com/spreadsheets/d/169qibpJCWgUy-SRtoyvKd1EKwV1nDfM0/edit#gid=773120038

in my case it's similar

but you should create a shareable link: https://youtu.be/GnXwGmhaI9U?t=179

then it looks different and ends with /edit?usp=sharing

1 Like

Thanks for that @Grzesiek2010.

I'm not sure about the shareable link. I have a workflow that uploads sheets to google sheets, copies the link, pastes it into the settings, and then uses python to create the xml, and it works flawlessly. Is that not supposed to happen? :joy:

Just in case, I modified the submission ID to the xml I copied above to use the shareable one (which has edit access) and I still get the same error. This makes sense intuitively because I created the sheet (my profile), and in ODK Collect I'm also authenticated into my profile, so there should not be a sharing problem...

But you say you got it to work? Did you specifically get this sheet to work? If so please share, otherwise, I think this ticket remains unsolved.

Any other suggestions?

PS - I also thought perhaps it was a problem w/ the relevant, so deleted that, to no avail.

Ok, the issue seems to be caused by the fact it's not a sheet created using Google Sheets, you created it using MS Excel (or a similar tool) and uploaded it to Google Drive. Am I right? I was able to reproduce the issue doing the same.

1 Like

Yes that's the reason. To fix it please create a new sheet, it can't be a file uploaded to your GD.

1 Like

Thank you @Grzesiek2010

I faced the same issue. I did the same mistake of copying the Submission URL from MS Excel. We should create a google sheet and then use it to copy the Submission link.

I faced the same issue: By selecting the Google Drive setting "Convert Uploads (Convert uploaded files to Google Docs editor format)" I was able to upload workbooks created in MS Excel to Drive and then copied the new URL to the settings page and recreated the xml (or just edit the submission entry in the xml) and the problem was resolved.

Thanks using the separate worksheet worked