Skip to contents

[Experimental]

Usage

form_restore(
  pid = get_default_pid(),
  id,
  url = get_default_url(),
  un = get_default_un(),
  pw = get_default_pw(),
  retries = get_retries()
)

Arguments

pid

The numeric ID of the project, e.g.: 2.

Default: get_default_pid.

Set default pid through ru_setup(pid="...").

See vignette("Setup", package = "ruODK").

id

The numeric ID of the deleted Form, e.g. from form_list(deleted = TRUE).

url

The ODK Central base URL without trailing slash.

Default: get_default_url.

Set default url through ru_setup(url="...").

See vignette("Setup", package = "ruODK").

un

The ODK Central username (an email address). Default: get_default_un. Set default un through ru_setup(un="..."). See vignette("Setup", package = "ruODK").

pw

The ODK Central password. Default: get_default_pw. Set default pw through ru_setup(pw="..."). See vignette("Setup", package = "ruODK").

retries

The number of attempts to retrieve a web resource.

This parameter is given to RETRY(times = retries).

Default: 3.

Value

A list with a single element success (TRUE) as per the ODK Central API docs.

Details

Deleted Forms can be restored as long as they have been in the Trash less than 30 days and have not been purged. A deleted Form with the same xmlFormId as an active Form cannot be restored while that other Form is active. This function uses the numeric ID of the Form (returned by form_list(deleted = TRUE)) rather than the xmlFormId to restore unambiguously. This endpoint requires ODK Central v1.4 or later.

Examples

if (FALSE) { # \dontrun{
# See vignette("setup") for setup and authentication options
# ruODK::ru_setup(svc = "....svc", un = "me@email.com", pw = "...")

trash <- form_list(deleted = TRUE)

form_restore(id = trash$id[[1]])
# > $success
# > [1] TRUE
} # }