Description Usage Arguments Value Author(s) Examples
Delete a list of records
1 2 3 4 5 6 7 | delete_multiple_records(
server_name,
profile_id,
page_id,
record_ids,
access_token
)
|
server_name |
String of the iFormBuilder server name |
profile_id |
Integer of the iFormBuilder profile ID |
page_id |
Integer ID of the page from which to delete the record. |
record_ids |
Integer vector of the record IDs to delete. |
access_token |
Access token produced by |
Integer vector of the deleted record IDs
Bill Devoe, William.DeVoe@maine.gov
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 36 37 38 39 40 41 42 | ## 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)
# Get IDs of the last two records added so they can be deleted.
records_to_delete = tail(parent_form_records$id, 2)
# Delete the last two records added to the form
deleted_records = delete_multiple_records(
server_name = "your_server_name",
profile_id = "your_profile_id",
page_id = form_id,
record_ids = records_to_delete,
access_token = access_token)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.