I have a google form/survey that saves the responses into a google sheet.
Data from the google sheet is going into my flexdashboard/shiny app but if a response is saved while someone is using the app - the only way to see the response is by actually clicking refresh in the browser.
I would like to add a button that can rerun the application without the user clicking refresh? Is this possible?
Here is some code I have written - I have some code that I put together but it doesn't seem to work.
---
title: "Test "
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(DT)
library(gsheet)
```
Inputs {.sidebar data-width=300}
-----------------------------------------------------------------------
```{r}
jscode <- "shinyjs.refresh = function() { history.go(0); }"
actionButton(jscode, "Refresh")
observeEvent(input$reset, {
})
```
Column
-------------------------------------
### Chart A
```{r}
data <- gsheet2tbl('https://docs.google.com/spreadsheets/d/1CB2IQHb3g5d8KsEr-_lJNXPKnTBn2nhz_-AzBjRyRK4/edit#gid=0')
datatable(data
,
editable = TRUE,
options = list(
columnDefs = list(list(className = 'dt-center', targets = "_all")))
)
```