Creating an Object-Based Hierarchy

This example describes a scenario where a construction company wants to use a single hierarchically ordered list of values for three separate properties referring to the location of a construction site. They want the hierarchical value list to be based on actual objects in their vault.

To create the required metadata structure and objects for this kind of scenario, follow the steps provided below. The names of the structure elements are examples only, and you can freely name them as you like.

First, open M-Files Admin and create the required metadata structure elements as instructed below.

  1. Create an object type with the names Area (singular) and Areas (plural).
    For instructions on creating object types, see Creating a New Object Type.
  2. Create four property definitions that have the names listed below. All of them should be of the data type Choose from list and should show values from the value list Areas, essentially consisting of various Area objects in your vault.
    • Belongs to area
    • Construction site continent
    • Construction site country
    • Construction site city

    For instructions on creating property definitions, see Creating a New Property Definition.

    Tip: You can optionally set the following filters for the continent and country properties if you want the continent property to only show continents and the country property to hide cities from the list:
    • Construction site continent: Class = Continent
    • Construction site country: Class != City
  3. Create the following three classes:
    • Continent
    • Country
    • City

    As the value of the Object type setting for each one, select Area.

    Under the Properties section, add the Belongs to area property for all the three classes. This way, the property is automatically added to the metadata card when you are creating these objects later on.

    For detailed instructions on creating classes, see Creating a New Class.

Next, open M-Files Desktop and create a hierarchy of continent, country, and city objects using the newly created metadata structure elements.

  1. Create a set of continents:
    1. Click the Create button in the top area and select Area.
    2. To the Class field, enter Continent.
    3. To the Name or title field, enter the name of the continent, such as Asia.
    4. Leave empty the value of the Belongs to area field as this is a top-level object.
      The top-level object must contain this property as well because it defines that it belongs to the same hierarchy as its descendant objects (in this example, countries and cities).
    5. Click Create once you are done.
    6. Repeat these steps for as many objects of this class as you require.
  2. Create a set of countries:
    1. Click the Create button in the top area and select Area.
    2. To the Class field, enter Country.
    3. To the Name or title field, enter the name of the country, such as India.
    4. To the Belongs to area field, enter the name of the continent in which this country is located, such as Asia.
    5. Click Create once you are done.
    6. Repeat these steps for as many objects of this class as you require.
  3. Create a set of cities:
    1. Click the Create button in the top area and select Area.
    2. To the Class field, enter City.
    3. To the Name or title field, enter the name of the city, such as Mumbai.
    4. To the Belongs to area field, enter the name of the country in which this city is located, such as India.
    5. Click Create once you are done.
    6. Repeat these steps for as many objects of this class as you require.
Finally, open M-Files Admin again and, by following the instructions in Specifying Hierarchical Properties, set the property definitions Construction site continent, Construction site country, and Construction site city to use the Belongs to area hierarchy. The configuration should look similar to the one presented below.
  • Hierarchies
    • Construction site continent
      • Hierarchy Name = Construction site continent
      • Target Property = Construction site continent
      • Hierarchy Property = Belongs to area
    • Construction site country
      • Hierarchy Name = Construction site country
      • Target Property = Construction site country
      • Hierarchy Property = Belongs to area
    • Construction site city
      • Hierarchy Name = Construction site city
      • Target Property = Construction site city
      • Hierarchy Property = Belongs to area
  1. Click Save and close M-Files Admin once you are done.
Now, when you add the properties Construction site continent, Construction site country, and Construction site city to the metadata of an object, they all show the same hierarchical list of areas that you can use to select the location of the construction site.


An example of a hierarchical, object-based value list.