After you create a layer, you need to create a custom form that you will later attach to that layer.

Custom form can be created in Map Editor application using the Forms Manager tool found in the Tools tab. When you add or create a point layer in your map, you can choose that point layer to be a template for the form creation. In the Create from layer option choose the layer and the form with the attribute fields will automatically appear.

Create a new form

  1. Open Tools tab.
  2. Open Forms Manager.
  3. Click Create new form button.
  4. Write a form name and title. Form name will appear in Map Editor, and form title will appear in MDC on the mobile device.
  5. Add form items by choosing from the drop down list.
  6. Click Save button.

Untitled

Form field options

For form items you can add following options:

  1. Dependencies dependent fields will appear in the form if the rules are satisfied.
  2. description provides an additional description of optional length to a particular field
  3. Persistent which remembers values from previous submission.
  4. Required which means that the submission can not be sent unless this field is populated.
  5. Default value which is one of the values in the form or the default value.
  6. Single line/multilne which allows you to write in a single line/multiple lines (for Text field).
  7. Autofill auto populate the field based on previously inserted values. More info here.

 

form-3

 

Connect form and layer

To collect data with the Mobile Data Collection, database point layer has to be connected with the form.

Note: if you are creating a project with the Mobile Data Collection Portal, form is automatically connected with the layer.

To connect a form with the layer, follow these steps:

  1. Open Layer Properties by clicking on the Layer tab and Edit Layer button.
  2. Click on the Attributes tab.
  3. Choose a custom form to use with the layer from the drop down list.
  4. NMT_Forms_Manager4

  5. Join each column with the corresponding form field from the drop down list e.g. column name is text_field, then from the drop down list Text field should be chosen.
  6. Click Save button.
  7.  

    Untitled2

You can also add some additional fields into the form but note that after that, you need to add these fields in your point layer (this can be done in the Database Manager) and attach it accordingly.

Refresh map and form on your mobile device and start collecting data!

Additional options

Add autofill text field in JSON

Autofil option can be added and edited without edition JSON file. For more info click here.

  1. Create a new String column in the layer. Click here for detailed instructions. Autocomplete form field will be connected with this column. If you already have a String column, you can skip this step. In our example, column name is “test_column”
  2.  

    Untitled4

     

  3. Open Forms Manager.
  4. From the drop down list select the form or create a new one. Note that forms created in Mobile Data Collection Portal (MDCP) are not editable. If you want to use the form created in MDCP, duplicate and save it.
  5. Switch to JSON view.
  6. Copy the form item syntax below. Paste it after “Items”: [ part in the JSON file
  7.  

     

    {
    “type”: “text”,
    “uuid”: “29594d11-faaf-4c12-9819-0557b364a8b2”,
    “name”: “test_column“,
    “persistent”: false,
    “required”: false,
    “title”: “Text field”,
    “description”: “”,
    “autocomplete”: {
    “layer”: “auto”,
    “queryExpression”: “test_column ILIKE ‘%${term}%'”,
    “valueExpression”: “${data.test_column}”
    }
    }

     

     

  8. Add comma (,) after the last bracket ( } ) if there are more form items after the autocomplete item.
  9. Rename column from test_column (bold letters in syntax above) to the column name where Autocomplete field will be connected and stored.
  10. Click Save.
  11.  

    Capture51

     

  12. In the Layer properties, under the Attributes tab select Autocomplete field from the drop down list next to column name and click Save.
  13.  

    Untitled6

     

  14. Layer and form in MDC on the mobile device should be auto-refreshed within a few minutes, but you can manually refresh them in MDC Settings.

 

 

Notes:

  • If layer is set “auto” in autocomplete item definition, autocomplete data will be shown from the layer with which the form is connected. You can set any database layer from the map by renaming “auto” in the layer name as it is written in Database.
  • It is also possible to set list of items that will be auto populated. Autocomplete will work as a select list with autocomplete search for those items. This option is useful for layers with large amount of data e.g. list of towns.

Send MDC data without coordinates

It is possible to send points without location information with Mobile Data Collection app.

  1. Open the map in Map Editor.
  2. Open Forms Manager.
  3. From the drop down list select the form or create a new one. Note that forms created in Mobile Data Collection Portal are not editable. If you want to use the form created in MDCP, duplicate and save it.
  4. Switch to JSON view.
  5. Copy the form item syntax below. Paste it after “title”: “Form name” and before “items”:[ in the JSON file
  6.  

    “noLocation”: true,

     

  7. Click Save.
  8.  

    Capture6

     

  9. Layer and form in MDC on the mobile device should be auto-refreshed within a few minutes, but you can manually refresh them in MDC Settings.
  10.  

    mdc_photo_cdv_photo_003_1463063097700