Description Usage Arguments Value Examples
Sends a request to the iFormBuilder API to append a list of options in json format to an existing option list. Please make sure that all option list key_values are unique, otherwise new options will not be posted.
1 2 3 4 5 6 7 | add_options_to_list(
server_name,
profile_id,
optionlist_id,
option_values,
access_token
)
|
server_name |
String of the iFormBuilder server name |
profile_id |
Integer of the iFormBuilder profile ID |
optionlist_id |
The id number for the option list |
option_values |
A list of option values in json format |
access_token |
Access token produced by |
A vector of option list element ids, one for each option in the list
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 | # The locations dataset is an example of a segmented option list
head(locations, 5)
# Convert locations dataframe to json
location_json <- jsonlite::toJSON(locations, auto_unbox = TRUE)
## 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 a new empty option list
new_option_list_id <- create_new_option_list(
server_name = "your_server_name",
profile_id = 123456,
option_list_name = "SGS-StreamLocations",
access_token = access_token)
# Inspect new option list id
new_option_list_id
# Add option elements from locations dataset to the new option list
option_ids <- add_options_to_list(
server_name = "your_server_name",
profile_id = 123456,
optionlist_id = new_option_list_id,
option_values = location_json
access_token = access_token)
# Inspect the first five new option list element ids.
head(option_ids, 5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.