create_element: Add element to page.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/elements.R

Description

Adds a new element to a page (form or subform).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
create_element(
  server_name,
  profile_id,
  access_token,
  page_id,
  name,
  label,
  description = "",
  data_type,
  data_size = 100,
  optionlist_id
)

Arguments

server_name

String of the iFormBuilder server name.

profile_id

Integer of the iFormBuilder profile ID.

access_token

Access token produced by get_iform_access_token

page_id

Page ID where the new element will be created.

name

String of the element DCN. The provided name will be converted to be IFB database compliant (no special characters, all lowercase, spaces replaced with underscores.)

label

Label for the element.

description

Text description of the element.

data_type

Integer indicating data type of the element.

data_size

*Optional* - length of the element; defaults to 100.

optionlist_id

*Optional* - id of the option list to assign if a Select, Picklist, or Multi Picklist element is created.

Value

ID of the new element.

Author(s)

Bill DeVoe, William.DeVoe@maine.gov

See Also

List of iFormBuilder data types: https://iformbuilder.zendesk.com/hc/en-us/articles/201702880-Data-Types-and-Related-Details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# Get access_token
access_token <- get_iform_access_token(
  server_name = "your_server_name",
  client_key_name = "your_client_key_name",
  client_secret_name = "your_client_secret_name")

# Create element
new_element <- create_element(
  server_name = "your_server_name",
  profile_id = "your_profile_id",
  access_token = access_token,
  page_id = "existing_page_id",
  name = "new_dcn_name",
  label = "new_element_label",
  description = "This is a new element.",
  data_type = 1)
  
## End(Not run)

arestrom/iformr documentation built on Nov. 25, 2021, 11:21 p.m.