columnStyle

Description

This function is used to modify existing styles and create new styles. Most of the time other helper functions will be more immediately useful:

  • minimalColumnStyle : retain only the columns exactly as in the web interface

  • prettyColumnStyle : use the web interface style but include record metadata

  • allColumnStyle : use all columns with a default to using the activityInfo formula style to label columns

A style can be set as a default style using defaultColumnStyle .

The column names options are:

  • "pretty": Using the labeling logic of the web user interface as much as possible, for example "Focus Country Name"

  • "label" : Using the form field labels in the style of ActivityInfo formulas, for example "[Focus Country].[Name]"

  • "code" : Using form field codes as defined by the user, for example "country.name". As codes are optional, the fallback columnName option can be specified as a vector, for example c("code", "label") or c("code", "id).

  • "id" : Using the form field unique id used by ActivityInfo, for example "c12c92vi5olfmn7khb4.c13cmf6la3lfmn7khb5"

Usage

columnStyle(
  referencedId = TRUE,
  referencedKey = TRUE,
  allReferenceFields = FALSE,
  columnNames = "pretty",
  recordId = TRUE,
  lastEditedTime = TRUE,
  style
)

Arguments

Argument Description
referencedId include the record id for values in referenced fields; default is TRUE to make it easier to join data in R.
referencedKey key fields from the referenced form; default is TRUE to make it easier to join data in R.
allReferenceFields include all the fields in referenced records; the default is FALSE
columnNames Can be "pretty", "label", "id", c("code", "id), or c("code", "label"); default is "pretty".
recordId include the record id of each record in the form table; default is TRUE to make it easier to join data in R
lastEditedTime the time the record was last edited; default is TRUE
style a style to modify with one or more parameters
Next item
createFormSchemaFromData