ropensci / ruODK

ruODK: An R Client for the ODK Central API
https://docs.ropensci.org/ruODK/
GNU General Public License v3.0
41 stars 12 forks source link

form_schema, form_schema_ext and form_xml retrieve only the latest form version #129

Open mtyszler opened 3 years ago

mtyszler commented 3 years ago

Feature

In its current form, form_schema(), form_schema_ext() and form_xml() retrieve the latest version of a form.

This is the most common use case. However, there are use cases in which retrieving previous versions of the form is useful, for example to compare changes over time.

To achieve this, a simple modification needs to be made to these functions.

In essence you need to replace the API url

v1/projects/{pid}/forms/{URLencode(fid, reserved = TRUE)}/fields

wtih

v1/projects/{pid}/forms/{URLencode(fid, reserved = TRUE)}/versions/{form_version}/fields

if a new parameter form_version (which can be NULL by default) is passed to the functions.


Let me know if you find this an interesting feature.