# Querying Locality Detail via Collection Object

**URL:** <https://speciforum.org/t/querying-locality-detail-via-collection-object/3180>\
**Category:** Get Help\
**Created:** [December 2, 2025, 4:57pm UTC](https://speciforum.org/t/querying-locality-detail-via-collection-object/3180 "2025-12-02T16:57:30Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [December 3, 2025, 3:32am UTC](https://speciforum.org/t/querying-locality-detail-via-collection-object/3180/9 "2025-12-03T03:32:10Z")

</div>

Hi @phb,

Thanks for reaching out!

I am able to build a query that returns results when searching via ‘Collection Object → Collecting Event → Locality → Locality Detail’ in the Query Builder in a copy of your database.

For example, you can see this query here ([Locality Detail Test](https://beaty.specifycloud.org/specify/query/471/)) where I searched for any cases where “Locality Detail → Island = `Mo'orea`” in the Algae collection and 11 results are returned.

 ![Locality Details -> Island Query Line](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/0/06fed6672261e7220cc44aa66f762929071fda34.png)

 ![Locality Detail results](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/f/fd18c7e84ea241f3e03e753a8a347c9a30e3a18b.png)

I believe the issue may be a matter of how scoping impacts query behavior. Your database follows this [institutional scoping hierarchy:](https://speciforum.org/t/specify-institutional-scopings/1046)

| Divisions | Disciplines | Collection Name |
| --- | --- | --- |
| Natural History | Botany 1 | Vascular Plants |
| Natural History | Botany 1 | Algae |
| Natural History | Botany 2 | Bryophytes |
| Natural History | Botany 2 | Lichen |
| Natural History | Botany 2 | Fungi |
| Natural History | Tetrapods | Birds |
| Natural History | Tetrapods | Herpetology |
| Natural History | Tetrapods | Mammals |
| Natural History | Marine Invertebrates | Marine Invertebrates |
| Natural History | Fishes | Fishes |
| Natural History | Paleontology | Paleontology |
| Natural History | Entomology | Entomology |
| Teaching and learning | Teaching and Learning | Teaching and Learning |

**Locality** , **Collecting Event** , and **Locality Detail** are scoped to the **Discipline** level, meaning querying any of these tables directly will return all records that exist within that discipline.

Querying for all cases where ‘Island’ is not empty from one of those base tables will display results, even if no Collection Objects in the ‘Mammals’ collection are connected.

I created the **[Locality with Detail](https://beaty.specifycloud.org/specify/query/474/)** query to demonstrate this behavior, showing the collection name of the associated Collection Object with each Locality (via the Collecting Event relationship)🔖

 ![Locality Detail Query](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/4/4a274955f9c320a8736adcac9b8efdb86e5d2778.png)

 ![Mammals Results](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/7/7d717f2efbc9b6003af80ffd42adcb3d76b21451.jpeg)

You can test this by running the **[Mammals Island Query](https://beaty.specifycloud.org/specify/query/475/)** that I created, showing this result when running that query in the ‘Mammals’ collection:

 ![Vancouver Island result](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/d/d711ae8bc670fb31d4406575e7fcfd360a4c3974.png)

I hope this clarifies things a bit! If you start from the Collecting Event or Locality side of things, you can return all records associated with a particular island or island group across collections, but querying Collection Object simply returns records from the _current_ collection.

---

_[View the full topic](https://speciforum.org/t/querying-locality-detail-via-collection-object/3180)._
