
Parse a form_schema into a tibble of fields with name, type, and path.
Source:R/form_schema_parse.R
form_schema_parse.RdUsage
form_schema_parse(fs, path = "Submissions", verbose = get_ru_verbose())Arguments
- fs
The output of form_schema as nested list
- path
The base path for form fields. Default: "Submissions".
form_schema_parserecursively steps into deeper nesting levels, which are reflected as separate OData tables. The returned value inpathreflects the XForms group name, which translates to separate screens in ODK Collect. Non-repeating form groups will be flattened out into the main Submissions table. Repeating groups are available as separate OData tables.- verbose
Whether to display debug messages or not.
Read
vignette("setup", package = "ruODK")to learn howruODK's verbosity can be set globally or per function.
Details
This function is used by form_schema for older versions of
ODK Central (pre 0.8). These return the form schema as XML, requiring the
quite involved code of form_schema_parse, while newer ODK
Central versions return JSON, which is parsed directly in
form_schema.
The form_schema returned from ODK Central versions < 0.8 is a nested list
of lists containing the form definition.
The form definition consists of fields (with a type and name), and form
groups, which are rendered as separate ODK Collect screens.
Form groups in turn can also contain form fields.
form_schema_parse recursively unpacks the form and extracts the
name and type of each field. This information then informs
handle_ru_attachments, handle_ru_datetimes,
handle_ru_geopoints, handle_ru_geotraces, and
handle_ru_geoshapes.
See also
Other utilities:
attachment_get(),
attachment_link(),
attachment_url(),
drop_null_coords(),
get_one_attachment(),
get_one_submission(),
get_one_submission_att_list(),
get_one_submission_audit(),
handle_ru_attachments(),
handle_ru_datetimes(),
handle_ru_geopoints(),
handle_ru_geoshapes(),
handle_ru_geotraces(),
isodt_to_local(),
odata_submission_rectangle(),
predict_ruodk_name(),
prepend_uuid(),
split_geopoint(),
split_geoshape(),
split_geotrace(),
strip_uuid(),
tidyeval,
unnest_all()
Examples
if (FALSE) { # \dontrun{
# Option 1: in two steps, ODKC Version 0.7
fs <- form_schema(flatten = FALSE, parse = FALSE, odkc_version = 0.7)
fsp <- form_schema_parse(fs)
# Option 2: in one go
fsp <- form_schema(parse = TRUE)
fsp
} # }