Skip to contents

create_sp_list_item() is an alternative to the create_item method for Microsoft365R::ms_list objects. This is used by create_sp_list_items() (instead of the bulk_import method) to better handle NA values that broken for number columns.

Usage

create_sp_list_item(
  ...,
  .sp_list = NULL,
  .fields = NULL,
  .keep_na = FALSE,
  .multi_fields = NULL,
  .coerce = c("basic", "asis", "geometry"),
  .validate = c("none", "warn", "error")
)

Arguments

...

Ignored if .fields is supplied.

.sp_list

A ms_list object.

.fields

A named list or single row data frame.

.multi_fields

Optional. Names of multi-value (Collection) fields, such as multi-select choice columns, that should always be sent as an array with an "@odata.type" annotation. If NULL, only fields with a length other than 1 are treated as multi-value fields.

.coerce

How to convert .fields values to match the list column types. One of "basic" (default), "asis", or "geometry". See the coerce argument for create_sp_list_items(). Use "asis" if values are already coerced.

.validate

What to do with .fields values that don't match the list column definitions. One of "none" (default), "warn", or "error". See the validate argument for create_sp_list_items().