Step 1: Filling a spreadsheet

Filling a spreadsheet in google docs goes always via a form:
After hitting the Submit button on this form the URL is send to Google docs:
https://docs.google.com/spreadsheet/formResponse?formkey=Here_goes_the_formkey&ifq&entry.0.single=opeens&entry.1.single=nu&pageNumber=0&backupCache=&submit=insturen

When you change the URL with the right values then you can send your data from a micro-controller or software to the spreadsheet.

Step 2: Use Google docs to collect data of a micro controller.

To use Google docs you need an account, if you make your project for somebody else then make for that project a new account.
Login and go in google docs to new-->form
Very importantvVia this form the data is collected and put in the spreadsheet.
No form, No spreadsheet.

For every parameter you will follow, make a field.
(# means a number
: means "this will be" "in the URL")

Standard HTML:
Text field : entry.#.single
textarea : entry.#.single
radio : entry.#.group // Same group number belongs to the same group.
checkbox : entry.#.group // Same group number belongs to the same group. entry.3.group=value1&entry.3.group=value2
option/select : entry.#.single

Special:
scale : based on type radio on a row
grid : based on type radio in a grid

The most used fields would be a text field for values and radio button for boolean.

I believe the format for the URL's for google's forms has changed. There is no longer a formkey, or it is not specified as it used to be. Does anyone know how to identify the formkey in the new URL format?

It is important that you replicate the exact structure in your code like in Step 4 there are a few variable you missed.

Write out your code as a URL and put it in your browser navigation then you can see what goes wrong.

Step 4:

const string FormKey = "Here comes the form key"; // Important DON't use the spreadsheet key. this is a different key

static string GoogleIP = "spreadsheets.google.com"; // Google adress

static Int32 GooglePort = 80; // Port Number 443=https 80=http

Fill the parameters:

formdata = "&entry.0.single=" + value.ToString();

formdata += "&entry.1.single=" + value.ToString();

formdata += "&entry.2.single=" + value.ToString();

formdata += "&entry.3.single=" + value.ToString();

formdata += "&pageNumber=0&backupCache=&submit=insturen"; // close with this these are hidden on the form

Also important is last line with the pagenumber=0 variable it is for me a few years ago it worked for me on the moment i'am not using it anymore maybe googledocs has changed dramatic. the trick is to replicate the HTML form data in your C code.

The console in not getting inside this block since client.connect(server, 80) returns false in my case. The issue you are addressing might be there after establishing a connection. But there is no connection established in this case. Find attached a simple code here with pushingbox as the intermediate way to the server. This is the output I get with the code attached.

I'am sending the data directly to google and not via an intermediate as pushingbox.

In your example code you are trying to login by pushingbox and not directly by google. All the error codes are from pushinbox and not from google i think.

I have seen somewhere on internet a example via pushingbox, i didn't want to make a account on the pushingbox site so i didn't dig deeply into that. I have not read the articles about pushingbox, mayby has the pushingbox site the right answer for you.

It is important that your code behave as a webbrowser the only check i now have, is via an URL and that is still working, my Netduino is not anymore connected to internet so i'am not 100% sure that my code still works.I'am only sure the URL typed in the webbrowser is working.

Hi cwalger, i have tried it with my code and it still works: spreadsheets.google.com/formResponse?formkey=Here comes your formkey&ifq&entry.0.single=10&entry.1.single=20&entry.2.single=30&entry.3.single=40&pageNumber=0&backupCache=&submit=insturen

Hi Spaceman, I have looked at it and have make a new form to test i think the idea from above instructable stil works. Look at the form source code find the tag of your field here you find the parameter name="entry.#" # mean a randomnumber(?) generated by googledocs/drive See step 2 of my instructable. I hope i have answered your question?