/
Form Autodownload for Client
Form Autodownload for Client
All forms in OpenSRP for Client apps are maintained on server in form directory in application core resources.
Form Structure:
Each form is composed of three files model.xml, form_definition.json, form.xml in a separate directory named by unique name for form.
Each form has three properties
- formName: The Name/ID specified in xls form by science team. This is also used to link nodes in model.xml and form_definition.json as bind
- formDirName: The name of folder with which developers access form file in enketo. All three files are in this directory
- formDataDefinitionVersion: The version of form to keep track of the form used for data submission
Form Access:
- To access the latest versions for all forms make a call to http://yourserver/form/latest-form-versions. For demo server call to http://46.101.51.199:8080/oweb/form/latest-form-versions
- The output is a json as follows
{"formVersions" : [{"formName": "ANC_Close_EngKan", "formDirName": "anc_close", "formDataDefinitionVersion": "2"},
{"formName": "ANC_Registration_OA_EngKan", "formDirName": "anc_registration_oa", "formDataDefinitionVersion": "4"},
.......,
{"formName": "Child_Vitamin_A_EngKan", "formDirName": "vitamin_a", "formDataDefinitionVersion": "1"}]}
- If you find any formDataDefinitionVersion lesser than the mentioned version, on your client, then
- Download the form by http://yourserver/form/form-files?formDirName=THE_FORM_TO_DOWNLOAD. For demo server call to http://46.101.51.199:8080/oweb/form/form-files?formDirName=THE_FORM_TO_DOWNLOAD . Where formDirName is the form directory name containing form files.
- The response is a zip file with name same as formDirName and containing three files form.xml, model.xml and form_definition.json
, multiple selections available,
Related content
How to add new forms to OpenSRP App
How to add new forms to OpenSRP App
More like this
Form Configuration User Documentation
Form Configuration User Documentation
More like this
How to upload configurable forms using the API
How to upload configurable forms using the API
More like this
How to update forms on OpenSRP app
How to update forms on OpenSRP app
More like this
OpenSRP Web APIs
OpenSRP Web APIs
More like this
Procedure for migrating to faster forms
Procedure for migrating to faster forms
More like this