GetAnswers: Get all the answers of a form.

View source: R/GetAnswers.R

GetAnswersR Documentation

Get all the answers of a form.

Description

Get all the current answers of a specific form. This function calls GetForm internally to understand the form structure.

Usage

GetAnswers(
  token,
  idForm,
  nameForm = NULL,
  source = NULL,
  createdAfter = NULL,
  createdBefore = NULL,
  updatedAfter = NULL,
  updatedBefore = NULL,
  createdBy = NULL,
  updatedBy = NULL,
  page = 1,
  page_size = 100,
  all_pages = TRUE
)

Arguments

token

String access token.

idForm

Numeric Id of the required form.

nameForm

String name of the required form. Used only when idForm is not supplied. When this parameter is used, one extra access quota is spent.

source

Optional filter. Origin of the answer: "web_public", "web_private" or "mobile".

createdAfter

Optional filter. Returns answers created after this date (exclusive). Accepts ISO 8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

createdBefore

Optional filter. Returns answers created before this date (exclusive). Accepts ISO 8601 format.

updatedAfter

Optional filter. Returns answers updated after this date (exclusive). Accepts ISO 8601 format.

updatedBefore

Optional filter. Returns answers updated before this date (exclusive). Accepts ISO 8601 format.

createdBy

Optional filter. Returns answers created by the user with this numeric ID.

updatedBy

Optional filter. Returns answers whose last update was made by the user with this numeric ID.

page

Integer. Starting page when all_pages = FALSE. Default: 1.

page_size

Integer. Number of records per API request (max 500). Default: 100.

all_pages

Logical. If TRUE (default), fetches all pages automatically and returns a combined result. If FALSE, returns only the page specified by page.

Details

To get more details about the fields provided by the result, please visit the API documentation.

Value

A list with two elements when the form has groups or multivalued fields: the first element is the main data frame (scalar fields and metadata), the second is a named list of nested data frames linked by main_df_id. For simple forms with no groups or multivalued fields, a single data.frame is returned directly. Use FlattenAnswers to join everything into one flat table.

Metadata columns in the main data frame: main_df_id, created_by_user_name, created_by_user_id, created_at_source, created_at, created_at_coordinates.latitude, created_at_coordinates.longitude, updated_at, updated_at_coordinates.latitude, updated_at_coordinates.longitude.

Examples


GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", 5705)
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             nameForm = "RColetum Test - Iris")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             createdAfter = "2012-12-20",
             createdBefore = "2018-12-20")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = "web_public",
             createdAfter = "2012-12-20T19:20:30+01:00",
             createdBefore = "2018-12-20T19:20:30+01:00")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             all_pages = FALSE,
             page = 1,
             page_size = 3)



RColetum documentation built on April 17, 2026, 1:07 a.m.