Dependent fields allows you to manage sets of dependencies between fields. When a field is dependent it will only be available for editing and displayed if the state of the parent field satisfies the right rule. If rule is not satisfied, it will not be possible to view or edit dependent form field. Note that first form field can’t be dependent.

To set dependent field open MDC Portal and create new project or open existing project.

Note: If rule is not satisfied, the dependent field will not be visible in the MDC.

 

dep1

 

There are various rules that can be activated for the form item:

  • All of these rules need to be satisfied.
  • At least one rule needs to be satisfied.
  • Exactly one rule should be satisfied.
  • None of the rules can be satisfied.

The dependency expressions can be set based on the following operators:

  • have a value – the parent field has to have any value in order to display the dependent field.
  • contain – the parent field has to contain the value defined in the dependent field in order to display the dependent field. This operator is case sensitive.
  • be less than – the value in the parent field has to be less than the value in the dependent field (works only with numeric fields).
  • be less or equal to – the value in the parent field has to be less or equal the value in the dependent field (works only with numeric fields).
  • be equal to – the value in the parent field has to be equal to the value in the dependent field (works only with numeric fields).
  • be more or equal to – the value in the parent field has to be more or equal to the value in the dependent field (works only with numeric fields).
  • be more than – the value in the parent field has to be more than the value in the dependent field (works only with numeric fields).

 

It is only possible to define dependencies for the form items above the dependant field because they branch from the parent field. It is possible to set more dependencies for one form field.

 

rules2

 

After choosing a rule, you can choose form fields included, condition, condition value and add another dependency.

 

rules333

 

Example 1

We want to collect data about buildings. Only if the building is a hotel, we want to take a picture of it. Only if the building is a hospital, we want to collect address.

1. Set “parent” field (in this example Building).

 

dep2

 

2. Add new Photo field and click Dependencies button. This form field will be dependent on “Building” form field. Set condition and enter the value.

rules444

Note: This form field will be visible in the MDC only if value in the “Building” field is equal to “Hotel”.

 

hotel

 

3. To collect address data only for hospitals, we have to add new dependency field. Add new text field and click Dependencies button.

 

dep44

 

Note: This form field will be visible in the MDC only if the value in the “Building” field is equal to “Hospital”.

hospital

 

The changes in Mobile Data Collection Portal should be automatically saved.

Example 2

We want to collect data about traffic signs. If the sign material is Acrylic and watercolour, Thermoplastic or Cold plastic we want to display the photo field.

1. Set parent field as a checkbox form item and define values (in this example Sign Material).

2. Add new Photo field and click Dependencies button. This form field will be dependent on Sign Material form field.

3. Select ‘contain’ operator and enter value defined in the Sign Material field.

4. Select the rule which defines when the dependent field will be visible.

contains-3

5. The changes should be automatically saved. Open MDC and select some of the values in the checkbox field. The dependent field should appear based on the defined dependencies.

mdc_photo_cdv_photo_003_1509463116783

Example 3

We want to collect data about traffic signs. If the traffic sign ID contains value ‘BB7’, we want to open additional field for notes in the form.

1. Set parent field as a text form item and give it a name (in this example Sign ID).

2. Add new text field and click Dependencies button. This form field will be dependent on Sign ID form field.

3. Select ‘contain’ operator and enter the value when the dependent field will be visible (in this example ‘BB7’).

Note: ‘contain’ operator checks if the part of dependent field’s value has the value defined in the parent field e.g. if the parent value is defined as BB7, the dependant field will be visible if in the parent field is written e.g. BB7a1234 or a1234BB7

4. Select the rule which defines when the dependent field will be visible.

contain-4

5. The changes should be automatically saved. Open MDC and insert the value in Sign ID field. The dependent field should appear based on the defined dependencies.

mdc_photo_cdv_photo_002_1509462628432