Versions Compared

Key

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

This is a mapping file that is written for every form which maps the fields within the form to Dristhi OpenSRP database. An example Now we would look into how a sample form_definition.json is belowfor this model.xml would look like (keep in mind we would be using the entity_relationship.json as mentioned earlier as the entity relationship in this case):

Code Block
languagejs
themeDJango
languagefirstlinejs1
titleform_definition.jsonfirstline1
linenumberstrue
{
    "form_data_definition_version": "1",
    "form": {
        "bind_type": "entity",
        "default_bind_path": "/model/instance/form_id/",
        "fields": [
            {
                "name": "field1",
                "source": "entity.value1",
                "bind": "/model/instance/form_id/field1",
                "shouldLoadValue": true,
                "value": "value1"
            },
            {
                "name": "field2",
                "source": "entity.value2",
                "bind": "/model/instance/form_id/field2",
                "value": "value2"
            }
        ]
    }
}

...