Detailed documentation with examples is self-contained within the package and also can be accessed here: https://teamworksapp.github.io/smartabaseR/index.html
The smartabaseR
package serves as an R wrapper for the Teamworks AMS API. At present, the package consists of two primary functions:
-
sb_get_event()
for downloading AMS data into R. -
sb_insert_event()
for uploading data from R up to AMS.
The package additionally includes several helper functions.
This article provides an overview of the Teamworks AMS R package and its capabilities, including the following topics:
Prerequisites
Because the Teamworks AMS R package relies on the Teamworks AMS API to work, the API must be enabled for your AMS instance. Please contact your Product Success Manager for more information.
Before you access any data, your AMS administrator will need to provide you with an account that is configured to access the data you need. You will need the following details:
- Username and password for your AMS account.
- URL of your AMS site (e.g.
https://example.smartabase.com/site)
.
Exporting data out of AMS
Exporting AMS data with smartabaseR is easy with the sb_get_event()
function. As well as your AMS credentials and URL, you will need to supply values to the form, start_date and end_date arguments at a minimum. Note that start_date
and end_date
must be in 'dd/mm/yyyy' format.
Constantly exporting data from your AMS site can put stress on the server, affecting your organization’s AMS experience. At a minimum, please save your exported data to a variable to minimize unnecessary API calls. If you are exporting especially large datasets that are not being updated regularly, save your pulled data to an RDS file so that it persists across R sessions.
Importing data into AMS
To import data back into AMS, you can use the sb_insert_event()
function. As well as your AMS credentials and URL, at a minimum you will need to provide sb_insert_event()
with a data frame containing the data to be imported, and the name of the AMS form you are uploading to.