Learn R Programming

qbr (version 1.3.0)

query_records: Query for data

Description

Get tabular data from a Quickbase table using a query.

Usage

query_records(
  subdomain,
  auth,
  from,
  select = as.numeric(),
  where = NULL,
  group_by = NULL,
  sort_by = NULL,
  agent = NULL,
  skip = 0,
  top = 0,
  local_time = FALSE,
  type_suffix = FALSE
)

Value

A tibble.

Arguments

subdomain

Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific.

auth

Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token).

from

Character vector with one element. Table identifier.

select

Optional. Numeric vector containing field identifiers for columns to return. If omitted, the default columns for the table will be returned.

where

Optional. Character vector with one element. Use the Quickbase query language to set criteria for records to returned.

group_by

Optional. Nested named list with 'fieldId' and 'grouping' pairs for each field to group by.

sort_by

Optional. Nested named list with 'fieldId' and sort 'order' pairs for each field to sort by. See Quickbase JSON API documentation for details on sort order configuration.

agent

Optional. Character vector with one element. Describes user/agent making API call.

skip

Optional. Integer. The number of rows to skip from the top of a record set.

top

Optional. Integer. The limit on the number of records to pull starting at the top of a record set.

local_time

Logical. When true, date time fields are returned using app's local time. When false, date time fields are returned using UTC time.

type_suffix

Optional. Logical. Set TRUE to append each field label with its Quickbase data type.

Examples

Run this code
if (FALSE) {

   # Get all data matching query specification
   my_tibble <- query_records(subdomain = "abc",
       auth = keyring::key_get("qb_example"),
       from = "bn9d8iesz",
       select = c(3, 6:9),
       where = "{8.EX.'6-month'}")

   # Query data, group, then sort it
   my_tibble <- query_records(subdomain = "bhi",
       auth = keyring::key_get("qb_example"),
       from = "bn9d8iesz",
       select = c(3, 8:12),
       sort_by = list(list(fieldId = 12, order = "ASC"),
                      list(fieldId = 3, order = "DESC")),
       group_by = list(list(fieldId = 4, grouping = "equal-values"),
                       list(fieldId = 9, grouping = "equal-values")))
}

Run the code above in your browser using DataLab