shinysurveys icon indicating copy to clipboard operation
shinysurveys copied to clipboard

Feature idea: multiple surveys?

Open nklepeis opened this issue 3 years ago • 2 comments

Hi, I'm getting back into using the package and loving its features! It is so useful. I'm planning to put some live surveys on shinyapps.io soon.

Do you have plans to support multiple surveys per shiny app? I can envision having dynamic surveys that popup in the course of a user journey or letting users select different surveys on different tabs. To accomplish this, I presume the package would need to allow for different id's (and labels) for each survey's "submit" actionButton and to have survey ids and tags for the different surveys when outputting survey data using getSurveyData().

--Neil

nklepeis avatar Aug 12 '21 20:08 nklepeis

Hi Neil! That's an interesting idea. I don't have any plans for this right now but will think about possible implementations.

jdtrat avatar Aug 14 '21 18:08 jdtrat

I made a workaround by using a dialog box on startup to have the user select a survey, which is then rendered with different data frames depending on their choice.

See the github archive here: https://github.com/nklepeis/AirSurveys The deployed shinyapp here: https://nklepeis.shinyapps.io/AirSurveys/

Some issues:

  1. On the first visit to the shinyapp URL there is an error that crashes the survey, but when reloading it starts working OK. The error when run locally is: Warning: Error in <-: 'names' attribute [1] must be the same length as the vector [0] 1: shiny::runApp

  2. Occasionally I notice that the "Submit" button is unavailable even though all of the questions are marked required=FALSE.. This is intermittent so I haven't been able to track it down.

Thanks again for this great package. I would love eventually to have more flexibility in creating multiple on-demand polls/surveys inside a complex shiny app, but for now the above solution seems to work for my present needs.

--Neil

nklepeis avatar Aug 15 '21 18:08 nklepeis