Save and load all the settings a user sets in a Shiny app


#1

I have a simple shiny app below in which the user can make some choices using those widgets. Is it possible to save and load all the settings as the user will set in the Shiny App, so that he can open the app the next time and load these same settings from a location on his computer, which then causes the app to change its settings immediately to how it used to be before?

#ui.r
navbarPage(
  "Application",
  tabPanel("General",
           sidebarLayout(
             
             sidebarPanel(
               uiOutput("tex1"),
               br(),
               uiOutput("num"),
               br(),
               
               uiOutput("num2")
              ),
               
             
             
             mainPanel(
               wellPanel(
                 h4("Format"),
                 fluidRow( # Width = sum of component columns
                   tags$style(type="text/css",
                              ".shiny-output-error { visibility: hidden; }",
                              ".shiny-output-error:before { visibility: hidden; }"
                   ),
                   column(3,
                          h5("Booklet ID"),
                          div(style="display: inline-block;vertical-align:top; width: 150px;",uiOutput("num3"))
                          
                          
                   )
                 )
                 )
              
               
               
             )
           )))
           
  
  
  
  
#server.r
library(shiny)


server <- function(input, output,session) {
  
  output$tex1<-renderUI({
    textInput("text", h4("Run Name") 
    )
  })
  output$num<-renderUI({
    numericInput("nm", 
                 h4("Items"), 
                 value = 50,min = 1)
  })
  output$num2<-renderUI({
    numericInput("nm2", 
                 h4("Dimensions"), 
                 value = 1,min = 0,max = max(input$nm))
  })
  output$num3<-renderUI({
    textInput("nm3", 
              h6("Column"), 
              value = 1)
  })
  
  
  
  
  
  
 
}

#2

It’s not exactly the same as what you’re envisioning, but would bookmarking state meet your needs?
https://shiny.rstudio.com/articles/bookmarking-state.html


#3

It saves the choices but how can I start the app with them after closing it in RStudio?