Hi, I'm trying to read every second a file which is a google sheet from a poll performed through google forms, and then present the table in a shiny dashboard. I'm using the reactiveFileReader() function but it doesn't work because the table doesn't update, it only happens when I refresh the web page. I also include invalidateLater(1000, session) inside renderDT({ }), and the table never updates, so I conclude that the problem is in the reactiveFileReader().
The code is the following:
library(shiny)
library(DT)
library(googlesheets4)
ui <- fluidPage(
titlePanel("Real Time NPS"),
sidebarLayout(
sidebarPanel(
),
mainPanel(
DTOutput("tabla1")
)
)
)
server <- function(input, output, session) {
rt_data <- reactiveFileReader(
intervalMillis = 1000,
session = session,
filePath = "https://docs.google.com/spreadsheets/d/17SZnF6mo0dNe8vlRjKmOZglzlpoNoYyZQaESkM-kkDU/edit#gid=1323543702",
readFunc = read_sheet
)
output$tabla1 <- renderDT({
rt_data()
})
}
shinyApp(ui = ui, server = server)
I really appreciate if you could help with this.
Thanks in advance.
Regards,
KM