Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before we move onto a typical field , we should look into a special kind of field that each “fieldsarray should start with if its an initiation of a bind type (i.e. not a follow up but when you first create an entity of a certain bindtype).

{

       "name": "id",

       "shouldLoadValue": true

     },

This tells the form to create a system generated id for a household (ie. the bindtype). This would populate the id column of the household table in the database in the opensrp client. Just remember to put this as a default first field when you expect an entity to be created.

...

Value: is the value the user entered in the form which is ‘256’. When the form opens if value is specified then Enketo pre-populated the field with the specified on the form.

ShouldLoadValue: 'true' field denotes that the field is auto-generated & is also used to show that a previous value shall be loaded and the source tells it where it should be saved

Moving on we have sub_forms . Sub forms are repeating groups. They are like exactly a form but would appear as a child of a form. Here the sub form has attributes exactly like the form but the bindtype is different. We can see here the bindtype is an eligible_couple which has a child relationship with household. Also the default bind path refers to the repeat group start tag of the form.

...