A common task in configuration dialogs is telling the extension where it should pull data from: from which worksheet, whether to use summary or underlying data is desired, and for underlying data with multiple logical tables, which logical table. This Shiny module provides a drop-in component for prompting the user for these inputs in a consistent and usable way.

choose_data_ui(id, label = NULL)

choose_data(
  id,
  options = choose_data_options(),
  iv = NULL,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

id

An identifier. Like a Shiny input or output id, corresponding UI (choose_data_ui) and server (choose_data) calls must use the same id, and the id must be unique within a scope (i.e. unique within the top-level Shiny server function, or unique within a given module server function).

label

Display label for the control, or NULL for no label.

options

See choose_data_options().

iv

A shinyvalidate::InputValidator object; almost certainly you'll want to use the one that shinytableau passes to you via the iv parameter of your config_server function (see the example below). If provided, choose_data will add validation rules to this object; specifically, validation will fail if the user does not select a worksheet.

session

The Shiny session object. (You should probably just use the default.)

See also

For an example, look at the config_ui and config_server defined in the datasummary example app, as well as the "Accessing Data" section of the Getting Started guide.