surveydown.org
  • About
  • Documentation
  • Templates
  • Package
  • FAQ
  • Blog
  1. Reactivity
  2. Live Polling
  • Templates
  • Basic
    • Default Template
    • Question Types
    • Questions Defined with YAML
    • Conditional Display
    • Conditional Navigation
  • Randomization
    • Random Options
    • Random Options Predefined
  • Reactivity
    • Reactive Questions
    • Reactive drilldown
    • External Redirect
    • Live Polling
  • Conjoint
    • Conjoint Buttons
    • Conjoint Tables
  • Custom
    • Custom Leaflet Map
    • Custom Plotly Chart
  1. Reactivity
  2. Live Polling

Live Polling

Reactivity
A reactive question template of live-polling with responses shown as a bar chart.
Published

March 4, 2025

To create this template, run this command in your R console:

surveydown::sd_create_survey(
  #path = "path/to/survey",
  template = "live_polling"
)

Refer to the Start with a template section for more details.

GitHub Repo

Note
  1. The live-polling feature requires connection to database and cannot be demonstrated in the template preview. Therefore, a screenshot of bar chart resulted by live-polling is shown here instead.
  2. To make this template work, you should firstly define your credentials by calling sd_db_config(), and then delete the ignore = TRUE argument in the sd_db_connect() function call. Once your survey is up and running, try to go through the survey several times. You’ll see the bar chart updating in real-time as new responses are submitted.
a screenshot of bar chart resulted by live-polling

In the screenshot above, the survey page shows the choice of the current session, as well as a bar chart of all responses from the database. The bar chart updates in real-time as new responses are submitted. This feature is useful for live polling or feedback sessions where you want to see how opinions change over time.

Back to top
 
  • Site made with , , and quarto