title: R Shiny: How to get the user input from the search box in a DT datatable?
body: <p>I have developed a dashboard using the <code>shiny</code> and <code>shinydashboard</code> packages in <code>R</code>. The dashboard has a <code>datatable</code> produced with the <code>DT</code> package. At the top of the table, there is a search box that allows users to filter the rows of the table by typing in an input. Is it possible to get this input and use it in a reactive expression elsewhere in the dashboard?</p>
  <p>Here is a toy example:</p>
  <pre><code>library(shiny)
  library(shinydashboard)
  library(DT)
  
  shinyApp(
    ui = shinyUI(
      dashboardPage(
        dashboardHeader(title = &quot;Example&quot;),
        dashboardSidebar(sidebarMenu(id = 'tabs', menuItem(&quot;Tab1&quot;, tabName = 'Tab1'))), 
        dashboardBody(tabItems(tabItem(tabName = &quot;Tab1&quot;, 
                                       fluidRow(column(width=6,box(DT::dataTableOutput('myTable'), width=NULL)),
                                                column(width=6,box(textOutput(&quot;myText&quot;), width=NULL))))))
        )
    ),
    
    server = function(input, output, session){
      mytbl &lt;- data.frame(Name = c('Matthew', 'Luke', 'John'), Grade=c(45, 20, 80))
      output$myTable &lt;- DT::renderDataTable({DT::datatable(mytbl, rownames=FALSE)})
      output$myText &lt;- renderText({ &quot;The value entered in the seach box should appear here!&quot; })
    }
  )
  </code></pre>