User Defined Fields (UDF)

You can create your own fields under the Project and Suppliers modules. In the Projects module, you can find the extra fields in the Overview tab, beneath the map.

User defined fields (UDF) can be only created in the API Admin. Normally, your Kompass Champion should have access on the API Admin.

To create your fields, you will initially have to create a Project UDF schema. Head to "Project UDF Schema" (1) and click "Add project UDF schema" (2).

Add a name and then you'll have to set the schema.


Understanding the Schema Definition


You can define a set of UDFs by creating a JSON object. Each key in the "properties"  object represents a new field. For each field, you define its type , label , default  value, and other properties.

Here are the available field types and the code required to define them.

Available Field Types and Code Examples


1. Text Field

This is a standard string field used for capturing text, such as notes or simple descriptions. You can allow it to be left empty by setting the type  to ["string", "null"] .

  • Example Use: A "Plot" description.
  • Code Definition:

    JSON

"plot": {
  "type": [
    "string",
    "null"
  ],
  "label": "Plot",
  "order": 1,
  "default": null
}

2. Checkbox (Yes/No)

This is a boolean field that appears as a simple checkbox. It's ideal for tracking true/false or yes/no information.

  • Example Use: A "RAMS Sent" checkbox.
  • Code Definition:

    JSON

"rams": {
  "type": "boolean",
  "label": "RAMS Sent",
  "default": false
}

3. Dropdown List

This field allows users to select a single option from a predefined list. Use the enum  property to list the available options. Including null  in the enum  list makes the field optional.

  • Example Use: A "State Area" field.
  • Code Definition:

    JSON

"section": {
  "enum": [
    "Central",
    "East",
    "North",
    "South",
    "West",
    null
  ],
  "type": [
    "string",
    "null"
  ],
  "label": "State Area",
  "order": 2,
  "default": null
}

4. Date Field

This field provides a calendar picker. By setting the format  to date , you ensure the input is correctly handled as a date.

  • Example Use: An "Archive Date".
  • Code Definition:

    JSON

"archive_date": {
  "type": [
    "string",
    "null"
  ],
  "format": "date",
  "label": "Archive Date",
  "order": 3,
  "default": null
}

5. Number Field

This field is used for entering numerical data only. You can set a default  value, such as 0 .

  • Example Use: An "Acres" field.
  • Code Definition:

    JSON

"acres": {
  "type": [
    "number",
    "null"
  ],
  "label": "Acres",
  "order": 4,
  "default": 0
}

Key Properties Explained


When defining your fields, use these properties:

  • label : The display name for the field that users will see (e.g., "Archive Date").
  • type : The data type. This can be boolean  , string  , or number . Using an array like "type": ["number", "null"]  makes the field optional.
  • default : The value the field will have by default. For example, false  for a checkbox , 0  for a number , or null  for an empty field.
  • enum : (For Dropdown Lists) An array of the available string options.
  • format : (For Date Fields) Use "date"  to specify a date field.
  • order : A number that controls the order in which the fields appear on the form.
  • Please note that all schema must start and end with
{
  "type": "object",
  "properties": {
(...)
  },
  "additionalProperties": false
}

An example of a schema with all types above can be seen below:

{
  "type": "object",
  "properties": {
    "plot": {
      "type": [
        "string",
        "null"
      ],
      "label": "Plot",
      "order": 1,
      "default": null
    },
    "rams": {
      "type": "boolean",
      "label": "RAMS Sent",
      "default": false
    },
    "section": {
      "enum": [
        "Central",
        "East",
        "North",
        "South",
        "West",
        null
      ],
      "type": [
        "string",
        "null"
      ],
      "label": "State Area",
      "order": 2,
      "default": null
    },
    "archive_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "label": "Archive Date",
      "order": 3,
      "default": null
    },
    "acres": {
      "type": [
        "number",
        "null"
      ],
      "label": "Acres",
      "order": 4,
      "default": 0
    }
  },
  "additionalProperties": false
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us