# Uniqueness

In Epicollect5 there are **two** distinct types of uniqueness:

* **Form**: uniqueness is across all the entries of a form
* **Hierarchy**: uniqueness is across all the child entries of a form (the parent entry is considered)

If your project has got a single form only, the uniqueness is always set to **form**. This means if you set a question like "What is your name" as unique, you cannot have the same name more than once.

{% hint style="info" %}
The comparison is case insensitive i.e. "John" and "john" are the same, despite the capital letter of "John".
{% endhint %}

If you have multiple forms, for each child form you have the option to decide if you want the answer to the question unique form wide or hierarchy wide. On a project featuring UNIVERSITY as the parent form, and DEPARTMENT as the child form, let's imagine you enter "*Imperial College"* as a UNIVERSITY entry and then you add DEPARTMENT entries to it, like *Biology*, *History*, *Media* etc.

If you would like to avoid having the same department entered more than once for a single UNIVERSITY entry, you might set the uniqueness on the DEPARTMENT name. If you set DEPARTMENT name to be unique as **form** though, you could enter "*Biology*" only once, regardless of the UNIVERSITY being Imperial College or another one, like Stanford. This would not work as "*Biology*" is a common department across universities in the world.

**Form uniqueness:**

![](/files/QmFeFUfFpckHfl1exTz2)

The solution is to set the uniqueness as **hierarchy**, to have the parent entry considered. This way the "*Biology*" DEPARTMENT can be entered only once but for each UNIVERSITY entry.

**Hierarchy uniqueness:**

![](/files/7njnUBXLCtYvfEDGzXyU)

To set the uniqueness for a question, select the question and go to the "Advanced" tab:

![](/files/pCHj6QBERaajlolfmhVO)

The first option is the **form** uniqueness, and the second option is the **hierarchy** uniqueness as described.

{% hint style="info" %}
The form(s) names will differ based on your project form names.
{% endhint %}

**The uniqueness constraint is available for the following question types:**

* TEXT
* NUMERIC
* PHONE
* DATE
* TIME
* TEXTBOX
* BARCODE

### Date & Time uniqueness

The uniqueness of DATE and TIME questions is based on the format selected.

DATE answers are saved in ISO 8601 format, without timezone and with the time set to midnight, i.e \``2022-01-15T00:00:00.000`\` therefore the comparison is done only on the date part.

<table data-header-hidden><thead><tr><th></th><th width="372"></th><th></th></tr></thead><tbody><tr><td>dd/MM/YYY</td><td>same day, month and year</td><td></td></tr><tr><td>MM/dd/YYYY</td><td>same day, month and year</td><td></td></tr><tr><td>YYYY/MM/dd</td><td>same day, month and year</td><td></td></tr><tr><td>MM/YYYY</td><td>same month and year, day not considered</td><td></td></tr><tr><td>dd/MM</td><td>same day and month, year not considered</td><td></td></tr></tbody></table>

TIME answers are saved in ISO 8601 format i.e `2022-05-12T12:34:45.000`but the date part is not considered for the uniqueness.

<table><thead><tr><th></th><th width="377"></th><th></th></tr></thead><tbody><tr><td>HH:mm:ss</td><td>same hours, minutes and seconds</td><td></td></tr><tr><td>hh:mm:ss</td><td>same hours, minutes and seconds</td><td></td></tr><tr><td>HH:mm</td><td>same hours and minutes, any seconds</td><td></td></tr><tr><td>hh:mm</td><td>same hours and minutes, any seconds</td><td></td></tr><tr><td>mm:ss</td><td>same minutes and seconds, any hour</td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.epicollect.net/formbuilder/uniqueness.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
