You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The is a new feature on ODK Collect called entities where you can link two forms and perform specific calculation from the data collected in the linked form.
currently, we have Linking a form as media file which works well with only Pulldata function.
Benefits of implementing the feature/enhancement
Ability to perform more calculations e.g max or min of data, or totals of certain column
Suggested implementation plan(Steps to be taken to implement feature)
Models
EntityList Model
The list where each entity will be saved to. Entities of the same type are organized in entity lists.
Field
Type
Required
Description
pk
IntegerField
Yes
Primary Key. Auto-generated
name
CharField
Yes
This is the name that the follow-up form will reference
project
ForeignKey
Yes
The Project the EntityList belongs to
created_at
DateTimeField
Yes
Auto-filled when object is created
updated_at
DateTimeField
Yes
Auto-filled when object is modified
name and project are unique together
RegistrationForm Model
This is the form (registration form) that creates entities in an entity list.
Field
Type
Required
Description
pk
IntegerField
Yes
Primary Key. Auto-generated
entity_list
ForeignKeyField
Yes
EntityList object that the form saves entities to. The same EntityList can be used in many different forms
xform
ForeignKeyField
Yes
XForm object that creates entities
is_active
BooleanField
No
If True the Registration is contributing entities to the EntityList. Default is True
created_at
DateTimeField
Yes
Auto-filled when object is created
updated_at
DateTimeField
Yes
Auto-filled when object is modified
entity_list and xform are unique together
Once a XForm that defines entities is created, an EntityList will be created. If an EntityList with the name you specify already exists, then that XForm will use that EntityList.
FollowUpForm Model
This is the form (follow-up form) that consumes entities from an entity list.
Field
Type
Required
Description
pk
IntegerField
Yes
Primary Key. Auto-generated
entity_list
ForeignKeyField
Yes
EntityList object that the form consumes entities from
xform
ForeignKeyField
Yes
XForm object that consumes entities
created_at
DateTimeField
Yes
Auto-filled when object is created
updated_at
DateTimeField
Yes
Auto-filled when object is modified
entity_list and xform are unique together
Entity
An entity created by a registration form
Field
Type
Required
Description
pk
IntegerField
Yes
Primary Key. Auto-generated
registration_form
ForeignKeyField
Yes
RegistrationForm object that created the entity
xml
TextField
Yes
Submission's XML
json
JSONField
Yes
Submission's XML to JSON
version
CharField
No
The XForm version used when the submission was made
created_at
DateTimeField
Yes
Auto-filled when object is created
updated_at
DateTimeField
Yes
Auto-filled when object is modified
Endpoints
Get EntityLists: GET /api/v1/entity-lists
Example
curl -X GET https://api.ona.io/api/v1/entity-lists
Suggested Feature / Enhancement
The is a new feature on ODK Collect called entities where you can link two forms and perform specific calculation from the data collected in the linked form.
currently, we have Linking a form as media file which works well with only Pulldata function.
Benefits of implementing the feature/enhancement
Ability to perform more calculations e.g max or min of data, or totals of certain column
Suggested implementation plan(Steps to be taken to implement feature)
Models
EntityList Model
The list where each entity will be saved to. Entities of the same type are organized in entity lists.
name
andproject
are unique togetherRegistrationForm Model
This is the form (registration form) that creates entities in an entity list.
entity_list
andxform
are unique togetherOnce a XForm that defines entities is created, an EntityList will be created. If an EntityList with the name you specify already exists, then that XForm will use that EntityList.
FollowUpForm Model
This is the form (follow-up form) that consumes entities from an entity list.
entity_list
andxform
are unique togetherEntity
An entity created by a registration form
Endpoints
Get EntityLists: GET
/api/v1/entity-lists
Example
curl -X GET https://api.ona.io/api/v1/entity-lists
Response
Get EntityLists for a specific project: GET
/api/v1/entity-lists?project=<project_id>
Example
curl -X GET https://api.ona.io/api/v1/entity-lists?project=1
Response
Get a single EntityList: GET
/api/v1/entity-lists/<entity_list_id>
Example
curl -X GET https://api.ona.io/api/v1/entity-lists/1
Response
Get Entities: GET
/api/v1/entity-lists/<entity_list_id>/entities
Example
curl -X GET https://api.ona.io/api/v1/entity-lists/1/entities
The properties returned for Entities should be the properties defined in the forms
save_to
Response
Download EntityList dataset: Use endpoint Get a specific metadata or GET
<username>/xformsMedia/<form_id>/<metadata_id>.csv
The text was updated successfully, but these errors were encountered: