1

I am trying to accomplish something very similar to what this poster asked.

However, some of the values that the user is able to input are lists.
For example, the input value input$file1 has sub-values input$file1$name,
input$file1$size,
input$file1$type, and
input$file1$datatype.

Furthermore, I have two inputs, input$remove and input$force, which can take in a list of strings from a selectInput field.

Lastly, the function that I am using to save the user inputs is saving the action buttons, and doing so in an odd format. These values are not loading properly when utilizing the load action button. Here is a sample of the code I am using to attempt this:

  observeEvent(input$load,{   

    if(!file.exists('inputs.RDS')) {return(NULL)}

    savedInputs <- readRDS('inputs.RDS')
    inputIDs      <- names(savedInputs) 
    inputvalues   <- unlist(savedInputs) 

    for (i in 1:length(savedInputs)) { 
      session$sendInputMessage(inputIDs[i],  list(value=inputvalues[[i]]) )
    }
  })

  observeEvent(input$save,{ 
    saveRDS( reactiveValuesToList(input) , file = 'inputs.RDS')
  })  

Thank you in advance for the help!

kRazzy R
  • 1,561
  • 1
  • 16
  • 44

0 Answers0