% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/odata_submission_rectangle.R
\name{odata_submission_rectangle}
\alias{odata_submission_rectangle}
\title{Rectangle the output of \code{\link{odata_submission_get}(parse=FALSE)}
into a tidy tibble and unnest all levels.}
\usage{
odata_submission_rectangle(
  data,
  names_repair = "universal",
  names_sep = "_",
  form_schema = NULL,
  verbose = get_ru_verbose()
)
}
\arguments{
\item{data}{A nested list of lists as given by
\code{\link{odata_submission_get}}.}

\item{names_repair}{The argument \code{names_repair} for
\code{tidyr::unnest_wider}, default: "universal".}

\item{names_sep}{The argument \code{names_sep} for
\code{tidyr::unnest_wider}, default: "_".
Un-nested variables inside a list column will be prefixed by the list
column name, separated by \code{names_sep}.
This avoids unsightly repaired names such as \code{latitude...1}.}

\item{form_schema}{An optional form_schema,
like the output of \code{\link{form_schema}}. If a form schema is supplied,
location fields will not be unnested. While WKT location fields contain
plain text and will never be unnested, GeoJSON location fields would cause
errors during unnesting.}

\item{verbose}{Whether to display debug messages or not.

Read \code{vignette("setup", package = "ruODK")} to learn how \code{ruODK}'s
verbosity can be set globally or per function.}
}
\value{
The submissions as un-nested tibble
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}
}
\details{
This function cleans names with \code{janitor::clean_names()} and drops the
prefix \code{value_}.
}
\examples{
\dontrun{
# Using canned data
data_parsed <- odata_submission_rectangle(fq_raw, verbose = TRUE)
# Field "device_id" is known part of fq_raw
testthat::expect_equal(
  data_parsed$device_id[[1]],
  fq_raw$value[[1]]$device_id
)

# fq_raw has two submissions
testthat::expect_equal(length(fq_raw$value), nrow(data_parsed))
}
}
\seealso{
Other utilities: 
\code{\link{attachment_get}()},
\code{\link{attachment_link}()},
\code{\link{attachment_url}()},
\code{\link{drop_null_coords}()},
\code{\link{form_schema_parse}()},
\code{\link{get_one_attachment}()},
\code{\link{get_one_submission}()},
\code{\link{get_one_submission_att_list}()},
\code{\link{get_one_submission_audit}()},
\code{\link{handle_ru_attachments}()},
\code{\link{handle_ru_datetimes}()},
\code{\link{handle_ru_geopoints}()},
\code{\link{handle_ru_geoshapes}()},
\code{\link{handle_ru_geotraces}()},
\code{\link{isodt_to_local}()},
\code{\link{predict_ruodk_name}()},
\code{\link{prepend_uuid}()},
\code{\link{split_geopoint}()},
\code{\link{split_geoshape}()},
\code{\link{split_geotrace}()},
\code{\link{strip_uuid}()},
\code{\link{tidyeval}},
\code{\link{unnest_all}()}
}
\concept{utilities}
