I am trying to read a data set using the browse option to upload data from pc. After that, I want to display file content to be automatically filled by using first column entry.
library(shiny)
library(shinydashboard)
ui<-(fluidPage(
titlePanel("Auto Fill"),
sidebarPanel(
autoFillDF<- fileInput('file1', 'Choose xlsx file',
accept = c(".xlsx")),
# actionButton("go", "update"),
selectizeInput("p1", choices = autoFillDF$WorklistNo, selected = NULL, label = 'WorklistNo'),
selectizeInput("p2", choices = NULL, label = 'Status'),
selectizeInput("p3", choices = NULL, label = 'Plant'),
),
mainPanel(
DT::dataTableOutput('table')
)
)
)
server<-(function(input, output, session) {
updateApp <- reactive({
data <- autoFillDF
data <- data[data$WorklistNo %in% input$p1,]
updateSelectizeInput(session, 'p2', choices = data$Status, selected = data$Status, server = TRUE)
updateSelectizeInput(session, 'p3', choices = data$Plant, selected = data$Plant, server = TRUE)
data
})
shinyApp(ui = ui, server = server)
output$table <- DT::renderDataTable(
DT::datatable(updateApp())
)
})
shinyApp(ui = ui, server = server)
This is my data set look like. I have to read all the column data. I want to put WorklistNo and rest should be autofill.
I have tried to understand your code and requirement and as per my understanding i have tried to build a simple solution to complete it...Please take a look on that..
UI LOOKS LIKE:
DATA Looks like
Please let me know if that works and anything to change...