Problem with linking NSBasic app to Google Drive Spreadsheet

I followed the instructions on the wiki (http://wiki.nsbasic.com/Google_Drive_API), and got my CLIENTID. I tried to run the Google Drive API, but did not see any button to authorize or allow. I am basically having trouble seeing my files on my Google drive, and getting the File ID numbers to put in my app. Any help would be appreciated. Perhaps Google has changed the API since the wiki was written?
Metabasalt

Just tried it here, with possibly similar results.

The ‘Authorize’ button is greyed out on startup because authorization is successful - so it’s working at least somewhat. Do you get any error messages in the Chrome console when you click on ‘List Files’?

I went back and reread the docs. Are you running in the local browser, or after deploying to Volt?

Deployment to Volt is required. (as well as all the credentials being set properly. In particular, make sure you put your own client ID into your app.)

I was trying to deploy to my own server: www.evwllc.co. I will try Volt.
Thanks
Bill

You’ll need to have some server side scripts to do that. Volt has them built in already.

Hi George:
Thanks for the emails, but I am not making any progress. I have tried a
Volt server, and used your sample Google Spreadsheet project. I have tried
running it with your Client ID and with mine. When I try running it from
the Volt server with my ClientID, I get an error message saying
GoogleDrive.js Uncaught Type Error: Cannot read property ‘files’ of
undefined. line 58 column 41. I must admit I do not have an IT background,
so most of this is new to me. To be honest, I think I need someone
"virtually looking over my shoulder" as I proceed. I am thinking of a Skype
screen share. I do not expect this for free as you and your programmers
have to be paid. How much would this cost me?
Bill

We’ll be happy to help. Send me a direct email.

What is the name of your app on the Volt Server?

Did you try the sample?

George:
The name of my app on the Volt server is wfsgss, and the url is:
https://wfsgss-altered-rightfully.volt.live/
This is the sample but with my ClientID.
I tried running just the sample with the ClientID that was in the sample
with the app name googlespreadsheet at this url on my Volt server:
https://googlespreadsheet-dispenses-utterly.volt.live/
neither of them is running.
I am in the process of trying to contact some friends who know more about
IT support than I do…
Bill

  1. Using AppStudio, go into btnAuthorize. Change the disabled property to false, then deploy to Volt and run again. Do you get any dialogs which you click on the Authorize button?

  2. Do you have the name of your Volt app set up in the GoogleAPI credentials?

Hi George:
Thanks for continuing to try to find the error in the google spreadsheet
app. I set the disable button to false, and added the name of the app to my
credentials. I ran the app from the Volt server on Chrome and got the
attached error message, when I clicked the authorize button in the app.
Bill

Hey George: Progress! I got the app to link to my google spreadsheets. I
just had to add my Client ID to the app rather than the one that was in the
sample. So now, I have my file ID
Bill

Good work! Now, on to the spreadsheet!

OK, I got the spreadsheet to load into my app. The key thing was to get my File ID into the app, and when I hard coded it into the Dim FILE_ID=… I was probably making mistakes. In the google spreadsheet sample app, I realized that after you click the list button it gets the file ID from the google drive. So, I just did Dim FILE_ID at the top of the app, and in the listFilesCallback function, I typed FILE_ID=files[3].id. The 3 indicates it is the 4 file in the list since the files are counted 0,1,2,3,…The app then puts the File ID in the FILE_ID variable.

First off. The number of the file can change in the Google drive, so I add more code so the app can find the file automatically. In the listFilesCallBack function, in the for loop, I put an if files[i].name=“File Name” Then FileNumber=i. Where File Name is the actual name of the file in the Google Drive, and FileNumber is a variable I dim at the beginning of the app. I do have a question. I want to use my app with other teachers and students. In order to authenticate the app, do I have to give out the gmail account and password to everyone who wants to use the app? I am concerned about security with doing that, but I can create a gmail account just for the app, so it does not contain personal info. Can the login info be hard coded into that app?

This sounds like a Google Drive question - we’re not experts on that.

Hard coding login into into an app sounds like a bad idea. It’s easy for someone to look at the code and get the passwords.

a question : i have succesfull login the google drive.
but if i want to display the filelist (common sample Google drive spreadsheets)
i get always the error : GoogleDrive.js
Uncaught TypeError: Cannot read property ‘files’ of undefined.
line 58 column 41
must the Googledrive.js also updated with the correct variabel files : ?

We haven’t updated this code in a long time. It’s likely that Google has changed the requirements.

Could you contact me directly so we can discuss a solution?

It work with a small parameter i had changed :slight_smile: