This is a bit hacky, but it works. It uses the "internal" function ( session$sendInputMessage ), which should not be called explicitly, so there is no guarantee that it will always work.
You want to save all the values ββof the input object. I get all widgets using reactiveValuesToList(input) (note that this will also save the state of the buttons, which is not entirely clear). An alternative approach would be to list exactly which widgets will be saved, but this solution will be less general, and you will have to update it every time you add / remove input. In the code below, I just save the values ββin a list called values , you can save it to a file, but you want (RDS / text file / whatever). Then, the download button scans this list and updates each entry based on the value in the list.
There is a similar idea in this thread.
library(shiny) shinyApp( ui = fluidPage( textInput("text", "text", ""), selectInput("select", "select", 1:5), uiOutput("ui"), actionButton("save", "Save"), actionButton("load", "Load") ), server = function(input, output, session) { output$ui <- renderUI({ tagList( numericInput("num", "num", 7), checkboxGroupInput("chk", "chk", 1:5, c(2,4)) ) }) observeEvent(input$save, { values <<- lapply(reactiveValuesToList(input), unclass) }) observeEvent(input$load, { if (exists("values")) { lapply(names(values), function(x) session$sendInputMessage(x, list(value = values[[x]])) ) } }) } )