# CO Query Returns Same Values for Taxon and Preferred Taxon Fields

**URL:** <https://speciforum.org/t/co-query-returns-same-values-for-taxon-and-preferred-taxon-fields/4245>\
**Category:** Get Help\
**Created:** [September 28, 2026, 6:14pm UTC](https://speciforum.org/t/co-query-returns-same-values-for-taxon-and-preferred-taxon-fields/4245 "2026-09-28T18:14:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lexiclevenger6](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@lexiclevenger6](https://speciforum.org/u/lexiclevenger6)\
**Post date:** [September 30, 2026, 10:33pm UTC](https://speciforum.org/t/co-query-returns-same-values-for-taxon-and-preferred-taxon-fields/4245/2 "2026-09-30T22:33:56Z")

</div>

Hi Emmy!

You are correct in that the issue is related to the Query Builder rather than your data. This is a bug related to issue [#8560](https://github.com/specify/specify7/issues/8560) on GitHub. I left a comment on the issue to let the developers know you encountered it! The bug leads to unexpected behaviors, like what you’ve described, when a query includes tree rank mappings through multiple relationships such as Taxon and Preferred Taxon. It was fixed in 7.12.1.1, but the resolution introduced more critical issues involving the query builder, so it was reversed in 7.12.1.2. I will explain a potential workaround for your query, but it may or may not be valuable for your use case since it changes how the results are organized.

The inclusion of a tree rank is what causes the problem, so it will not occur if you exclude ranks from the query. **You can try using the (any rank), Parent, and Child relationships instead**. Rather than searching for related records in a certain rank, the Parent and Child relationships search directly for the parent or child of the Taxon record used in the determination. Then, you can search for the parent of the parent, and so on, to search as far up the taxon tree as you want.

 ![Query using any rank, parent, and child relationships](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/7/73549cb808928112f555c7e32baf259b076ebed2.png)  
[Import this query](https://speciforum.org/t/export-and-import-a-query/1227):  
[Show preferred and synonym.json](https://speciforum.org/uploads/short-url/8nYxhe3CPDLhjTN352CHBf7eA0w.json) (4.8 KB)

Keep in mind that since the Parent/Child relationships depend on the rank directly above/below the Taxon used in the determination rather than the rank defined in the query, **the values in those columns will not always belong to the same rank**. In the image below, record 000043577 is determined to a record at the Genus level. Record 000043578 is determined to a record at the Subspecies level. You can use the treeDefItem relationship to show you the rank name if needed, as shown in the image below.

 ![Query using any rank, parent, child, and taxon tree def item relationships](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/1/1c4405486a2032395997bf21911f655b40770f6c.png)  
[Import this query](https://speciforum.org/t/export-and-import-a-query/1227):  
[Show preferred and synonym with rank name.json](https://speciforum.org/uploads/short-url/3Z66Fec7xRJ3fkXQWgV1fAk01EK.json) (8.6 KB)  
Note: I [turned off localized field labels](https://speciforum.org/t/form-meta-menu/844#p-1379-use-localized-field-labels-5) for this query so you can see the schema names of the fields and relationships. Due to a bug, the treeDefItem column name appears as `$-any` in the query results.

I hope this helps! Please let me know if anything needs clarification.

Best,  
Lexi

---

_[View the full topic](https://speciforum.org/t/co-query-returns-same-values-for-taxon-and-preferred-taxon-fields/4245)._
