Saving text input from shiny permanently?

1.1k views Asked by At

We are building a Shiny app and plan to share the link to shinyapps.io.

We are wondering if there is any way to collect feedback from users - e.g. is there a way to have a text input field and permanently save the inputs for us?

Many thanks!

1

There are 1 answers

0
Mikael Jumppanen On BEST ANSWER

There is this project: ShinyChat which can be used as starting point for user feedback collection system.

Link to app: Live Chat

So in theory you need to have global reactiveValues() where you store your log.Rds and then you add user input to that log file. You may want to use R package stringgr. Example code:

library(stringgr)
log <- reactiveValues() #This have to be outside shinyServer so that all users can see it

    shinyServer(function(input, output, session) {
        addFeedBack <- function(file, string) {
            ...
            return(modifiedFile)
        }
        observe({
            log$logfile <- addFeedBack(log$logfile, input$userFeedback)
        })
    }

EDIT: I did some research and actually there is really nice article and example in an official shiny page: Share data So you will encounter some problems if you are planning to host your app on ShinyApps.io. and article gives solution for that.