title: Is there a way to override a reactive value in Rshiny with a fileInput
body: <p>I'm trying to allow the user to either <strong>(a)</strong> upload a file (in this case mtcars) or <strong>(b)</strong> push a button and retrieve the file but with a condition (in this case mtcars$gears = 0).  The user can upload the file. Fine.  The user can select the button.  Fine.  But when the user selects the button, and then uploads the file, it doesn't upload the file.  It keeps the condition mtcars$gears = 0.</p>
  <pre><code>library(dplyr)
  library(shiny)
  
  ui &lt;- fluidPage(sidebarLayout(
    sidebarPanel(
      fileInput(&quot;file1&quot;, &quot;Choose CSV File&quot;, accept = &quot;.csv&quot;),
      checkboxInput(&quot;header&quot;, &quot;Header&quot;, TRUE),
      br(),
      actionButton(&quot;button1&quot;, &quot;Populate all gear with 0s&quot;)
    ),
    mainPanel(tableOutput(&quot;contents&quot;))
  ))
  
  server &lt;- function(input, output) {
    rv = reactiveValues()
    
    rv$table1 &lt;- reactive({
      file &lt;- input$file1
      ext &lt;- tools::file_ext(file$datapath)
      
      req(file)
      #validate(need(ext == &quot;csv&quot;, &quot;Please upload a csv file&quot;))
      
      read.csv(file$datapath, header = input$header)
    })
    
    
    observeEvent(input$button1, {
      rv$table1 = reactive(mtcars %&gt;% mutate(gear = 0))
    })
    
    output$contents &lt;- renderTable({
      rv$table1()
    })
    
  }
  
  shinyApp(ui, server)
  
  
  </code></pre>