# Unique Collector Number

**URL:** <https://speciforum.org/t/unique-collector-number/2005>\
**Category:** Get Help\
**Created:** [October 7, 2024, 2:01pm UTC](https://speciforum.org/t/unique-collector-number/2005 "2024-10-07T14:01:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pverley](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/pverley/32/1413_2.png) [@pverley](https://speciforum.org/u/pverley)\
**Post date:** [October 7, 2024, 2:01pm UTC](https://speciforum.org/t/unique-collector-number/2005/1 "2024-10-07T14:01:59Z")

</div>

Since [Specify 7.9.3](https://speciforum.org/t/specify-7-9-3-release-announcement/1499), the Schema Config allows configuration of Uniqueness rules. Documentation on [Configuring Uniqueness Rules](https://speciforum.org/t/configuring-uniqueness-rules/1487) explains:

- how to establish uniqueness rules on a per table basis.
- for one or more fields
- within a given scope (database by default)

I’ve been thinking whether the feature could be adapted to ensure **unique collector number for a given collector** (the primary collector when collector is a group), within the scope of the collection.

It does not seem achievable as it is? It would be some kind of **uniqueness rule across tables** , in my case between:

- `stationFieldNumber` from `collectingEvent` table
- `GUID` from `agent` table where `collector::isPrimary=TRUE`

Any hint?

---

<div class="post-metadata">

**Author:** ![bronwyn](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/bronwyn/32/5742_2.png) [@bronwyn](https://speciforum.org/u/bronwyn)\
**Post date:** [October 31, 2024, 6:03pm UTC](https://speciforum.org/t/unique-collector-number/2005/2 "2024-10-31T18:03:50Z")

</div>

Hi,

Thank you for reaching out, we’re so glad you’re exploring the uniqueness rule configuration tool in Sp7!

From my understanding, you’d like to set a particular Agent to be primary by default when added as as a Collector. Unfortunately, this functionality would be outside of the uniqueness rule configuration tool framework. As you’ve observed, you cannot configure uniqueness rules that reference fields from the `agent` table when working within the context of the `collectingEvent` table.

Given these limitations, you might need to implement a manual validation step during data entry to ensure that the collector numbers remain unique.

If this feature is crucial for your workflow, I encourage you to submit a [New Feature Request](https://speciforum.org/c/new-features/37)!
