remote database

i see in the guide that you can connect to a remote data base to an app in shinyapps.io

is this only for pulling data from the database to the app or can i push data to the database from an app running in shinyapps.io?

example: data entry

when submit button is clicked in the shiny app the data entered is sent to the remote database

Hi, yes you can push the data to the remote database, and there is also the possibility to upload files to dropbox, google drive, etc.

hey - glad you mentioned google drive

I'm trying to set up connection between my lab (e.g., localhost) and one of my gmail accounts to test using google sheets/drive

when i run the app that I've built just to see if it would connect to the sheet i get

This site can’t be reached

localhost refused to connect.

the code looks like this:

library(shiny)
library(shinydashboard)
library(googlesheets4)

read_sheet("URL of the sheet here")

i don't have 0Auth set up on my gmail, its just username and pwd
i tried using the g24_auth, but that was an epic fail...

i don't think this app would ever be commercial

the goal is to get the app up and running on my local machine but connected to my gmail/gdrive for sheet access
then eventually migrate to shinyapps.io so i can put authentication in front of the app -

Hi, when you call the function read_sheet it will open an url that asks for authentication, and then it asks if you want to cache the token.
I think you're running the app from different laptop? if this is the case, then you might run it for the first time on your computer, and then after authorize the app you copy the token to the remote server.

If this is not the case, then maybe you closed the app before the authentication completed, or the port is blocked by firewall or something.

I am not really sure, so if you can do more tests and provide more details I might help.

Sorry for the delay hich -
I don't get much attention on here - my questions are typically too trivial...ha!

I'm going to circle back on this now that I know Google sheets can be read and written to.

Cheers ~!

Hi @osrs, sorry I didn't understand several things you mentioned there like having 0Auth set up on your gmail and g24_auth

Let me know if my suggestions doesn't solve the issue, or if they are unrelated to the issue you're having.

PS: to tag someone you just type "@" and the editor suggests the name.
Best.

@hichammoadsafhi

i have something posted with more detail here:

googlesheets4 localhost refused to connect

1 Like