title: Update selectInput error "Error in force(ui) : object 'ui' not found"
body: <p>I have a shiny app with work pretty well but I want to improve it and add some functionality.</p>
  
  <p>My data look like:</p>
  
  <pre><code>NITG &lt;- c("L447", "G24M", "G112", "F144", "B33D", "M4A1", "G432", "K54N", "K312", "K24K")
  RC &lt;- c("7E", "8E", "7D", "2G", "2B", "1D", "2J", "7M", "4H", "1D")
  Pheno &lt;- c("ZZ", "SS", "ZE", "ZZ", "ZZ", "ZLMN", "BB", "ZA", "GG", "ZZ")
  GRADES &lt;- c("D", "C", "D", "D", "C", "A", "D", "D", "D", "D")
  
  data &lt;- data.frame(NITG, RC, Pheno, GRADES)
  </code></pre>
  
  <p>What I want is :</p>
  
  <p>When I choose a modality for my variable, for example lets take "L447" for the NITG, I want to show only "7E" for RC in RC variable filter and not all the RC I got in my data, "ZZ" for Pheno variable ...etc
  I want something similar to Excel filter. Maybe I need some reactive function i'm stuck right now.</p>
  
  <p>Thanks for help </p>
  
  <pre><code>ui &lt;- fluidPage(
  
    titlePanel("Referentiel Renault Nissan"),
  
    sidebarLayout(
      sidebarPanel(selectInput("nitg",
                               "NITG:",
                               c("All", unique(filtered_df$NITG)),
                               selected = "All",
                               multiple = TRUE),
                   selectInput("pheno",
                               "Phenomenon:",
                               c("All", unique(filtered_df$Pheno)),
                               selected = "All",
                               multiple = TRUE),
                   selectInput("rc",
                               "RC:",
                               c("All", unique(filtered_df$RC)),
                               selected = "All",
                               multiple = TRUE),
                   selectInput("grade",
                               "Grades:",
                               c("All", unique(filtered_df$GRADES)),
                               selected = "All",
                               multiple = TRUE)
      ),
  
      mainPanel(
        DT::dataTableOutput("tableprint")
      )
    )
  )
  
  server &lt;- function(input, output, session) {
  
    output$tableprint &lt;- DT::renderDataTable({
  
      # Data
  
      NITG &lt;- c("L447", "G24M", "G112", "F144", "B33D", "M4A1", "G432", "K54N", "K312", "K24K")
      RC &lt;- c("7E", "8E", "7D", "2G", "2B", "1D", "2J", "7M", "4H", "1D")
      Pheno &lt;- c("ZZ", "SS", "ZE", "ZZ", "ZZ", "ZLMN", "BB", "ZA", "GG", "ZZ")
      GRADES &lt;- c("D", "C", "D", "D", "C", "A", "D", "D", "D", "D")
  
      df &lt;- data.frame(NITG, RC, Pheno, GRADES)
  
      # Create filters based on inputs
      f1 &lt;- if("All" %in% input$nitg){
        df$NITG
      } else {
        input$nitg
      }
  
      f2 &lt;- if("All" %in% input$pheno){
        df$Pheno
      } else {
        input$pheno
      } 
  
      f3 &lt;- if("All" %in% input$rc){
        df$RC
      } else {
        input$rc
      }
  
      f4 &lt;- if("All" %in% input$grade){
        df$GRADES
      } else {
        input$grade
      }
  
      # Filter data
      filtered_df &lt;- filter(df, 
                            NITG %in% f1,
                            Pheno %in% f2,
                            RC %in% f3,
                            GRADES %in% f4)
  
      # Update selectInput choices based on the filtered data. Update 'selected' to reflect the user input.
      updateSelectInput(session, "nitg", choices = c("All", filtered_df$NITG), selected = input$nitg)
      updateSelectInput(session, "pheno", choices = c("All", filtered_df$Pheno), selected = input$pheno)
      updateSelectInput(session, "rc", choices = c("All", filtered_df$RC), selected = input$rc)
      updateSelectInput(session, "grade", choices = c("All", filtered_df$GRADES), selected = input$grade)
  
  
  
  
      datatable(filtered_df)
  
    })
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>