Google Drive Spreadsheet

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Google Drive Spreadsheet

Post by Opaquer » Thu Dec 11, 2014 12:52 am

Hey all! Posted this question a few days ago in a different section, but didn't have much luck there, so trying here instead :)

I'm having a bit of trouble with the latest project of mine. I've got a Google spreadsheet that has a list of names of my co-workers, along with some information about them. The aim of the project was to make my app read the Google spreadsheet and put the data into a table. After a lot of testing it out, I finally got it working (woohoo!), but there's one slight issue. I'm using put url with my spreadsheet's ID, and I found that for some reason, out of the many lines of code of the spreadsheet, that line 73 has the contents of the table. So I've got line 73 in my app and it works and everything, but the only issue is that for some reason, it only picks up 100 rows, and I've got much more than 100 rows in the spreadsheet :(. If anyone knows any reason as to why it's only picking up 100 rows, or how I can make it work for the spreadsheet I have (I can't edit the spreadsheet, as it's someone else's job to do that and they won't be happy doing extra work just for the app :P), any help will be greatly appreciated :)

Thanks in advanced, and hoping to get this app up and running soon!

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Google Drive Spreadsheet

Post by LCNeil » Thu Dec 11, 2014 12:27 pm

Hi Opaquer,

I believe google docs, by default, will only show the first 100 rows in the page source. The rest are dynamically created on the page when needed. You should be able to work around this by passing certain parameters with the spreadsheet url. An example is forcing the output to HTML with the following

https://docs.google.com/spreadsheets/d/ ... html&gid=0

Replacing the key parameter with the key(id) of your spreadsheet.

The link contains an example spreadsheet with 180 rows and the data returns as expect with "put url"

Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Google Drive Spreadsheet

Post by Klaus » Thu Dec 11, 2014 1:34 pm

Hi Opaquer,

I deleted the double posting, please only one post per problem, thanks!


Best

Klaus

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Google Drive Spreadsheet

Post by Opaquer » Fri Dec 12, 2014 1:01 am

Thanks Klaus. Sorry for double posting, but since it's a work project, there's a bit of a deadline, and I wasn't getting much luck in the other place :P

Also runrevneil, I've got one more question. I've got my spreadsheet set up so that each person has their own little section, and a bit of information relating to various dates. So, for example, "John" will have his own heading, then beneath it he's got his name next to the date something occurred, and it's the same for each person. In your spreadsheet, you've managed to get it to show 2 columns, and no headers, but for some reason when I try with my sheet, there are headers and 10 columns. I've used the importrange function in Google Sheets to get the data from another spreadsheet so that it's all in one place, and there's 10 columns in that data, so that's probably why there's 10 columns in the html version. But for some reason, no matter what I do, the first 2 rows on my data is put into the header of the table, and nothing I've done has been able to fix it :(

Edit: Also, I tried adding a row at the top saying "Date" and "Name", to try get it to put that into the header, but for some reason, it still wants to put the first line of data into the header as well :(

Second edit: I figured it out. The first date was in the wrong format, so it wanted to make it part of the header. Once I fixed it, I haven't had an issue :). Now just to get it into a table in Livecode, and should hopefully be good to go :P

Post Reply