This function sends a message to an existing SurveyJS widget rendered in the UI, allowing you to update its data, read-only mode, theme, locale, or schema dynamically from the server using Shiny.
Usage
updateSurveyjs(
session,
id,
data = NULL,
read_only = NULL,
schema = NULL,
theme = NULL,
locale = NULL
)
Arguments
- session
Shiny session object.
- id
Output ID used in
surveyjsOutput()
.- data
Optional named list of answers to set.
- read_only
Optional logical; toggle read-only mode.
- schema
Optional new schema (list or JSON string).
- theme
Optional theme name (e.g.
"modern"
).- locale
Optional locale code (e.g.
"en"
,"de"
).
Examples
if (FALSE) { # \dontrun{
# Inside a Shiny app server function:
updateSurveyjs(session, "mysurvey", data = list(q1 = "Yes"))
} # }