Skip to content Skip to main navigation Skip to footer

How to set up dependency based on item values?

Dependent fields allow you to manage sets of dependencies between fields. Apart from setting it up on field items, you can set it up for value items as well. 

Dependencies for value items can be a very useful tool if you want to divide value items into groups for your collectors.

If a value is dependent it will only be available for editing and displayed if the state of the parent value satisfies the right rule set by you. If the rule is not satisfied, it will not be possible to view or edit dependent form fields.

To activate certain values, there are various rules that need to be satisfied. They are the same as in dependencies for field level:

  • 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.

Also, 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.
  • 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).

To set up dependency on value items in your project, please follow these steps:

  1. Open MDC Portal with GIS Cloud credentials
  2. Create a new project or edit an existing project
  3. Add Select list as a form item

Note: It is possible to set up dependencies only for Select list values.

  1. Fill out the values under Details
  2. Click on Dependencies button on the value list
  1. Set up the rules and expressions to activate those values
  2. Save the project

You set as many dependencies as you want for each value. Also, you can use option Copy from previous dependency to make the process of creating dependencies even quicker.

Example

We wanted to create a project in which we need to choose one country from the list of continents. So, after creating a new project, we added a list of continents as a Checkbox form field.

Then, for the next field, we added the Select list. For value items we placed a few countries from each continent. 

For each value in the Select list, we added a dependency for the value item. For items “Germany, France, and Spain” we placed a rule that the “Continent” field should be equal to “Europe”.

This means that if you select Europe from “Continent” field, than in “Select one country” field, you would be able to select either Germany, France or Spain. 

Let’s check how it works in MDC app.

If we select Europe from the list of continents, then in the “Select one country” field we get to choose from Germany, France and Spain. The same goes if we choose Asia from the list of continents.

Was This Article Helpful?