Description Usage Arguments Details Value Warning Examples
Sends a request to the iFormBuilder API to get all records in a
given form or subform for a specific set of fields (columns). This function
can be used to exceed the API limit of 1000 records per request. It will loop
through chunks of 1000 records at a time until all records have been retrieved.
You can also specify chunk size (< 1000) using the limit
parameter.
Specify how many records to skip before starting to retrieve records using
the offset
parameter.
1 2 3 4 5 6 7 8 9 10 11 | get_all_records(
server_name,
profile_id,
page_id,
fields = "fields",
limit = 1000,
offset = 0,
access_token,
field_string,
since_id
)
|
server_name |
String of the iFormBuilder server name |
profile_id |
The id number of your profile |
page_id |
The id of the form or subform |
fields |
A set of data fields (columns) to return |
limit |
The maximum number of records to return |
offset |
Skips the offset number of records before beginning to return |
access_token |
Access token produced by |
field_string |
A character string defining the data fields to return,
including the id value where data retrieval should start. See the example
above for how to define the |
since_id |
The id value defining the first record to retrieve. |
This function should be used with caution. It should only be used in those rare cases when you know that there are more than 1000 records that need to be retrieved in a single call. Be observant for warnings. It may on occassion throw errors. For more information on how to construct a string that specifies fields and conditions to apply to a request for records, see the Introduction section of the iFormBuilder Apiary
A dataframe of records for the specified fields (columns)
This function should only be used to request
records from one form or subform at a time. Do not assume it will
work if records from more than one form are incorporated in the
fields
parameter. If you request multiple fields but the function
only returns the id value, and does not throw an error, this is a strong
indication that you did not specify the fields correctly. You may have
requested a field that does not exist.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Specify the fields (columns) to be returned
field_list <- glue::glue("observers, survey_start_datetime, ",
"survey_method, stream, start_point")
## Not run:
# Set id to ascending order and pull only records greater than the last_id
since_id <- 5L
field_string <- glue::glue('id:<(>"{since_id}"), {field_list}')
# 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")
# Get the id of a single form in the profile given the form name
form_id <- get_page_id(
server_name = "your_server_name",
profile_id = 123456,
page_name = "your_form_p",
access_token = access_token)
# Get all existing records for a set of columns from a form or subform
parent_form_records <- get_all_records(
server_name = "your_server_name",
profile_id = 123456,
page_id = form_id,
fields = "fields",
limit = 1000,
offset = 0,
access_token = access_token,
field_string,
since_id)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.