title: How can I build multiple inputs into my shiny app with both updating and multiple selection?
body: <p>I am building a <code>flex dashboard</code> / <code>shiny</code> app with a <code>datatable</code> and trying to build in two inputs as selections for this <code>datatable</code> with an "All" choice for each selection. First question is how can I limit the second selection <code>"user"</code> by the selection of the first choice <code>"team"</code>?</p>
  
  <p>Then, using these inputs, I'd like to subset my data to any combination of the two selections ex. Team All, user "Darwin D" would return a single line datatable with his name, team and other metrics to be added etc.</p>
  
  <p>All code for a flex markdown document below:</p>
  
  <pre><code>---
  title: "example"
  output: 
    flexdashboard::flex_dashboard:
      orientation: columns
      vertical_layout: fill
      runtime: shiny
  ---
  
  ```{r setup, include=FALSE}
  library(shiny)
  library(shinydashboard)
  library(flexdashboard)
  library(magrittr)
  library(feather)
  library(anytime)
  library(data.table)
  library(DT)
  library(datasets)
  
  
  Name &lt;- c("Allan A","Barbara B","Charles C","Darwin D","Evelyn E","Frank F","Greg G","Hans H")
  Team &lt;- c(1,2,3,3,2,1,2,2)
  users &lt;- data.frame(Name,Team)
  remove(Name,Team)
  ```
  
  
  
  Inputs {.sidebar}
  =======================================================================
  
  ### Input Variables
  
  ```{r global_input}
  # input variable to call selection, name of field, selections/options variable
  dateRangeInput('dateRange',
       label = 'Date range input: yyyy-mm-dd',
       start = Sys.Date() - 8,
       end = Sys.Date() - 1,
       min = "2013-01-01",
       max = Sys.Date() -1
     )
  
  selectInput("teaminput","Team", c("All",unique(users$Team)))
  
  observe({
      if( input$teaminput == "All" ) {
          subDT &lt;- copy( users )
      } else {
          subDT &lt;- users[ users$Team == input$teaminput, ]
      }
  
      updateSelectInput(
          "userinput",
          label = "User Name",
          choices = c( "All", unique(subDT$Name ) )
      )
  })
  ```
  
  ### Intake Coordinator KPIs
  
  ```{r daily_table}
  # reactive data object based on inputs above
  daily_dt &lt;- reactive({
    if(input$teaminput == "All"){
        subDT
  }  else{
      subset(subDT$Team == input$teaminput)
  }
    })
  
  # render DT datatable object with sorts/search
  renderDataTable(daily_dt())
  ```
  </code></pre>