Version texte.

(See below for update. Turns out I should've RTFM *blush*.)
Yesterday night, I hacked together a little script that notifies some of my friends via email when a given sort of changes have been made to a Google Spreadsheet that we are working on. It was a nice opportunity to familiarize with the new API – it may still lack some advanced features, but it's simple, logical and easy to use.
However, I was bitten by one peculiarity that is not documented too clearly: It appears that the list-based feeds only cover the the rows above the first empty row regardless whether more data may be present after the gap. The cell-based feeds, on the other hand, will report all non-blank cells, regardless of blank rows.

I don't know if this is a feature or a bug, but I think it is important to keep it in mind when querying data that was entered manually by the user – after all, it's easy for a human editor inadvertently to leave a row blank, and client applications that use the list-based feed would then just refuse to take notice of the rest of the spreadsheet.
Note that the same goes for structured queries based on list feeds and cannot be circumvented specifying a start-index higher than the row where the gap occurs.
Therefore, for the time being, it would appear more appropriate to use cell-based feeds when a spreadsheet could have been modified by manual user-input.

UPDATE: Turns out I must have skipped the relevant section in the documentation. In fact, it is well documented and the recommended work-around is to insert a single dot in empty rows. Thanks to Pamela Fox from Google for pointing this out.

UPDATE 2: It's important to note that you'd have to manually insert the dots. Therefore, in my example, i.e. if your client application reads a spreadsheet that has been edited manually by a user, I'd still stick to the cell-based approach because a user cannot be trusted not to leave rows blank inadvertently.

Retour au début de la page

Catégories: Web Development and Programming

Mots clés/tags:

| Commentaires (0) | Rétroliens (0)

Rétroliens

URL rétrolien :
http://christianflury.com/cgi-bin/mt/mt-tb.cgi/27

Ici vous pouvez ajouter un commentaire

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Christian Flury

World 0.1

Lien au flux RSS de mon blog.