Unique

Overview

In the process of designing forms within ActivityInfo, maintaining data integrity and preventing duplication is crucial. The Unique property enables you to constrain values entered in a field so that only one record in the form can contain a given value for that field. This article explains how you can use the Unique property to enforce uniqueness constraints for fields, ensuring that specific field values remain distinct across all records within a form.

Behaviour

In a form, if you mark a field as "unique," it means that no two records in your form can have the same value in that particular field. This helps to keep your data clean and prevents any confusion or errors caused by having the same information repeated in different places within the form.

The uniqueness constraints can be applied to the following field types:

  • Fortnight
  • Serial Number
  • User
  • Date
  • Month
  • Text
  • Week
  • Single selection
  • Calculated
  • Barcode

Setting uniqueness constraints: 

The following steps outline how to enforce uniqueness constraints for fields:

  • Navigate to the relevant form settings to either add a new field or edit an existing one.
  • Navigate to the field settings options on the right side of the Field card editor.
  • Select the "Unique" property for the field. This property is only shown when relevant and applicable to the specific field type.
  • Next, confirm your changes by saving the form settings.

When you create or edit a record in a field with a uniqueness constraint, ActivityInfo verifies that relevance and validation rules are respected.

Limits

Uniqueness constraints are not assessed for records entered via collection links, the API and the importer.

Example

Ensuring Unique Beneficiary IDs in Cash Distribution Programs

An example of enforcing uniqueness constraints in ActivityInfo might involve a form used to track beneficiary payments in a cash distribution program. Suppose there's a field designated as "Beneficiary ID" which is marked as unique.

This means that each beneficiary's ID number must be distinct; no two beneficiaries can have the same ID within the form.

By following these steps, you can confidently enforce uniqueness constraints for fields within ActivityInfo, ensuring that your data remains accurate, distinct, and free from duplication.  

Next item
Explanation