Skip to contents

Pulls OData submissions from an ODK server using the ruODK package and stores the downloaded files in a temporary (or user‑specified) folder.

Usage

get_submitted_data(
  output_folder = tempdir(),
  wkt = TRUE,
  display_form_structure = FALSE
)

Arguments

output_folder

Character. Directory where the downloaded files are written. Defaults to tempdir().

wkt

Logical. Should geospatial data be returned as Well-known-text (TRUE) or as GeoJSON (FALSE)? Default to TRUE

display_form_structure

Logical. Default to FALSE. See details

Value

A data‑frame containing the OData submissions received from the server. The function also prints a message with the the number of individuals/observations in the database. If display_form_structure = TRUE an HTML page with an interactive visualization of the form structure.

Details

when display_form_structure = TRUE, the ODK form structure is retrieved and displayed using the listviewer package, allowing for interactive viewing and editing in JSON format.`

Examples

## -----------------------------------------------------------------
## The following examples illustrate typical usage.  They are wrapped in
## \dontrun{} to avoid contacting a live server.
## -----------------------------------------------------------------
if (FALSE) { # \dontrun{
# Download all submissions to a temporary folder
df_all <- get_submitted_data()

# Show the form structure (will be displayed after the return statement
# if the function is modified accordingly)
get_submitted_data(display_form_structure = TRUE)
} # }