# remotes::install_github("surveydown-dev/surveydown", force = TRUE)library(surveydown)# Database setup# surveydown stores data on a database that you define at https://supabase.com/# To connect to a database, update the sd_database() function with details# from your supabase database. For this demo, we set ignore = TRUE, which will# ignore the settings and won't attempt to connect to the database. This is# helpful for local testing if you don't want to record testing data in the# database table. See the documentation for details:# https://surveydown.org/store-datadb <-sd_database(host ="aws-0-us-west-1.pooler.supabase.com",dbname ="postgres",port ="6543",user ="postgres.yppmohklyshsiwkpadqa",table ="Woody",# ignore = TRUE)# Server setupserver <-function(input, output, session) {# Define any conditional skip logic here (skip to page if a condition is true)sd_skip_if()# Define any conditional display logic here (show a question if a condition is true)sd_show_if()# Database designation and other settingssd_server(db = db )}# shinyApp() initiates your app - don't change itshiny::shinyApp(ui =sd_ui(), server = server)# viola
1
copy-paste from Supabase “Connection parameters” (see previous tab).
2
Supabase has a “Table Editor” identifier. The name you choose here will appear on the Supabase site.
3
Allows the survey to be launched without connecting to the database. If responses are provided, they will be stored within a local preview_data.csv file (within your project directory).