% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract.R
\name{extract_ls}
\alias{extract_ls}
\title{List all approved fields in the UKB dataset}
\usage{
extract_ls(dataset = NULL, pattern = NULL, refresh = FALSE)
}
\arguments{
\item{dataset}{(character) Dataset file name, e.g.
\code{"app12345_20260101.dataset"}. Default: \code{NULL} (auto-detect).}

\item{pattern}{(character) Optional regex to filter results by
\code{field_name} or \code{title}. Default: \code{NULL}.}

\item{refresh}{(logical) Force re-fetch from cloud, ignoring cache.
Default: \code{FALSE}.}
}
\value{
A data.frame with columns:
\describe{
\item{field_name}{Full field name as used in extraction, e.g.
\code{"participant.p31"}, \code{"participant.p53_i0"}.}
\item{title}{Human-readable field description, e.g.
\code{"Sex"}, \code{"Date of attending assessment centre | Instance 0"}.}
}
}
\description{
Returns a data.frame of all fields available for extraction in the current
UKB project dataset. Fields reflect what has been approved for your project
— not all UKB fields are present.
}
\details{
Results are cached in the session after the first call. Subsequent calls
return instantly from cache. Use \code{refresh = TRUE} to force a new
network request (e.g. after switching projects).
}
\examples{
\dontrun{
# List all approved fields
extract_ls()

# Search by keyword
extract_ls(pattern = "cancer")
extract_ls(pattern = "p31|p53|p22009")

# Force refresh after switching projects
extract_ls(refresh = TRUE)
}
}
