Find the columns described by list metadata from get_sp_list_metadata()
that match a single type or property, e.g. all lookup columns or all
required columns. Pass the result to vctrs::vec_slice() to subset
sp_list_meta.
Usage
pull_sp_list_cols(
sp_list_meta,
col_type = c("required", "hidden", "indexed", "readOnly", "boolean", "calculated",
"choice", "contentApprovalStatus", "currency", "dateTime", "geolocation",
"hyperlinkOrPicture", "lookup", "number", "personOrGroup", "term", "text",
"thumbnail", "all", "editable", "external"),
names_from = c("name", "displayName"),
call = caller_env()
)Arguments
- sp_list_meta
List column metadata returned by
get_sp_list_metadata(): either a data frame (as_data_frame = TRUE) or a list with one element per column (as_data_frame = FALSE).- col_type
Column type or property to match:
"hidden", "indexed", "readOnly", or "required" match columns where the logical property of the same name is
TRUE(NAis treated asFALSE).A column type from
sp_list_col_types, e.g. "text", "number", or "lookup", matches columns with the column type property (facet) of the same name. For data frame input, a column matches if the nested facet data frame has any non-missing value for that column. "boolean", "contentApprovalStatus", "geolocation", and "thumbnail" columns can only be identified from list input because these facets are empty objects ({}) that are dropped when the API response is simplified to a data frame."all" matches every column.
"editable" matches columns where
readOnlyis notTRUE."external" matches columns with a name not in
sp_list_internal_colnames.
- names_from
Property to use for names of the returned vector. One of "name" (default) or "displayName".