title: R Shiny: How can I make multiple elements reactive in add/remove button context?
body: <p>I am creating a shiny app such that when I click on add or remove button, multiple reactive elements are affected.  I have simplified significantly what I am trying to do below.  Basically, we get selectInput() and textInput() boxes side-by-side, such that the textInput() box is populated with the user-chosen result of selectInput() box.  I then have an add button and remove button, such that by clicking the add button, on the next line down, we get new selectInput() and textInput() boxes side-by-side.  As above, the new row's textInput() box displays the user-chosen result of the new row's selectInput() box.  </p>
  
  <p>The issue I am having is being able to reference the new value of the new seletInput() box.  Using a get() reference does not work, and I need an iterative way to be able to reference these values as new boxes are added and removed.  How can I successfully call references to the result of successive selectInput() boxes?</p>
  
  <pre><code>suppressWarnings(library(shiny))
  suppressWarnings(library(shinyFiles))
  
  
  ui &lt;- function(request) {
      fluidPage(
          fluidRow(
              column(2,
                  uiOutput("ui1")
              ),
              column(2,
                  uiOutput("ui2")
              ),
              column(1,
                  actionButton(inputId = 'insertParamBtn', label = "Add Param")
              ),
              column(1,
                  actionButton(inputId = 'removeParamBtn', label = "Remove Param")
              )
              ),
          tags$div(id = 'placeholder'),
          hr(),
          fluidRow(column(12, verbatimTextOutput("view", placeholder = T)))
              )
  }
  
  server &lt;- function(input, output, session) {
      params &lt;- reactiveValues(btn = 0)
      output$ui1 &lt;- renderUI({
          selectInput("UI1", "First UI",
              choices = thisList, selected = 1)
      })
      output$ui2 &lt;- renderUI({
          textInput("UI2", "Second UI", value = input$UI1, width = '150px')
      })
  
      observeEvent(input$insertParamBtn, {
          params$btn &lt;- params$btn + 1
          insertUI(
              selector = '#placeholder',
          ## wrap element in a div with id for ease of removal
              ui = tags$div(
                  id = paste0('param', params$btn + 1),
                      tags$p(fluidRow(
                          column(2,
                              selectInput(paste0("UI1", params$btn + 1),
                                          paste0("First UI ", params$btn + 1),
                                          choices = thisList, selected = 1)
                                  ),
                          column(2,
                              textInput(paste0("UI2", params$btn + 1),  #*#
                                  paste0("Second UI ", params$btn + 1),  #*#
                                  value = get(paste0("input$UI1", params$btn + 1)),  #*#
                                      width = '150px')    #*#
                                  )
                                  )
                              )
                              )
                              )
      output$view &lt;- renderPrint({ get(paste0("UI1", params$btn + 1)) })
      })
  
      observeEvent(input$removeParamBtn, {
      removeUI(
      ## pass in appropriate div id
              selector = paste0('#param', params$btn + 1)
                  )
      params$btn &lt;- params$btn - 1
      })
  
      }
      shinyApp(ui = ui, server = server)
  </code></pre>