title: How to get row values from selected row in a Data Table in R Shiny App
body: <p>I need to get the selected row 1st column value from the DT Data Table. Using, <em>DataTable_rows_selected</em> , I am able to get the selected row count, Now I am looking for ways to extract the row values from the data table. In the example below, there are two <em>observeEvent</em> based on action button, 1st observe event is import and displays the data and 2nd one needs to display the selected row 1st col value so that I can use the same achieve other features. Please note,In Actual Application, the imported data is a web service API and which  I am parsing in R and converting to data frame.</p>
  <h1>Sample Example:</h1>
  <pre><code>library(shiny)
  library(shinydashboard)
  library(DT)
  
  ui &lt;- dashboardPage(
  dashboardHeader(title = &quot;Data Table Example&quot;),
  dashboardSidebar(
  sidebarMenu(
    menuItem('Tabs', tabName='tabs',
             menuSubItem('Tab 1', tabName='tab1'),
             menuSubItem('Tab 2', tabName='tab2')
    )
  )
  ),
  
  dashboardBody(
  
  tabItems(
    tabItem(tabName='tab1',
            actionButton(&quot;import&quot;,&quot;Import&quot;),
            br(),
            tags$div(tags$h3(tags$b(&quot; Get Selected Row Values&quot;,align=&quot;middle&quot;,style=&quot;color: rgb(57,156,8)&quot;))),
            br(),
            DT::dataTableOutput('ProductDataTable')
    ),
    tabItem(tabName='tab2',
            actionButton(&quot;display&quot;,&quot;Display&quot;),
            uiOutput('info')
     )
   )
   )
   )
  
  server &lt;- function(input, output) {
  
  observeEvent(input$import,{
  
  Product &lt;- read.csv2(&quot;RulesData.csv&quot;, header=TRUE, sep=&quot;;&quot;)
  
  output$ProductDataTable &lt;- DT::renderDataTable({
  
  DT::datatable(Product,selection = &quot;single&quot;,
  
                  extensions = c('Buttons', 'ColReorder', 'FixedHeader', 'Scroller'),
                  rownames=FALSE,
                  options=list(dom = 'Bfrtip',
                               searching = T,
                               pageLength = 25,
                               searchHighlight = TRUE,
                               colReorder = TRUE,
                               fixedHeader = TRUE,
                               filter = 'bottom',
                               buttons = c('copy', 'csv','excel', 'print'),
                               paging    = TRUE,
                               deferRender = TRUE,
                               scroller = TRUE,
                               scrollX = TRUE,
                               scrollY = 700
  
                  ))
  })
  
  })
  
  observeEvent(input$display,{
  
  row_count &lt;- input$ProductDataTable_rows_selected
  
  output$info &lt;- renderPrint({
  
    cat('Row Selected: ')
    cat(row_count, sep = ', ')
    cat(Product[1,2], sep = ', ')
  
  
   })
  
  })
  }
  
  shinyApp(ui, server)
  </code></pre>