Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying surveys based on reactive dataframe input? #60

Open
cmperez024 opened this issue Feb 22, 2023 · 0 comments
Open

Displaying surveys based on reactive dataframe input? #60

cmperez024 opened this issue Feb 22, 2023 · 0 comments

Comments

@cmperez024
Copy link

cmperez024 commented Feb 22, 2023

Hello.

One part of an app I'm making has users enter a URL to a google sheet which generates a survey based on the dataframe read from said sheet. I was able to get it working for the most part by creating a uiOutput which can be later updated using surveyOutput. This gets the survey displaying without using renderSurvey. However, there are some things that are supplied by renderSurvey, such as disabling the submit button if not all responses are filled in. Is there a way I can fix this?

df <- data.frame(question = "What is your favorite food?",
                 option = "Your Answer",
                 input_type = "text",
                 input_id = "favorite_food",
                 dependence = NA,
                 dependence_value = NA,
                 required = F)


  ui <- fluidPage(
    uiOutput("survey")
  )
  
  server <- function(input,output,session){

    # this reactive value in my app is updated based on what url the user submits.
    survey_df <<- reactiveVal(df)
    
    # in my app, this code is ran after the user submits a URL
    output$survey <- renderUI({
      surveyOutput(survey_df())
    })
        
    observeEvent(input$submit, {
    })
  }
  shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant