# \[BUG\] Can't use a flatten fields as Reference field

**URL:** <https://community.forestadmin.com/t/bug-cant-use-a-flatten-fields-as-reference-field/3329>\
**Category:** Feature suggestions\
**Tags:** howtos\
**Created:** [September 23, 2021, 10:28am UTC](https://community.forestadmin.com/t/bug-cant-use-a-flatten-fields-as-reference-field/3329 "2021-09-23T10:28:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautier](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/gautier/32/2287_2.png) [@Gautier](https://community.forestadmin.com/u/Gautier)\
**Post date:** [September 23, 2021, 10:28am UTC](https://community.forestadmin.com/t/bug-cant-use-a-flatten-fields-as-reference-field/3329/1 "2021-09-23T10:28:34Z")

</div>

Hi.  
Its seems that we can select a flatten field as a reference field but it’s not displayed unless the related “object” as been opened once.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/3/3afe0f7a5586e820f1311c9f0aa84afc689c1385.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/ebcb3e48f76127526328678c7a43947df6dc7be2.png)

(after a click on the first card and a refresh of the list, by clicking on the search field and pressing enter the reference field is correctly displayed)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/fa5aed7c593cd1cfabb9b9374c9b65dd25875f93.png)

---

<div class="post-metadata">

**Author:** ![jganichot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jganichot/32/3649_2.png) [@jganichot](https://community.forestadmin.com/u/jganichot)\
**Post date:** [November 30, 2021, 8:12pm UTC](https://community.forestadmin.com/t/bug-cant-use-a-flatten-fields-as-reference-field/3329/2 "2021-11-30T20:12:24Z")

</div>

Yes I’ve just been scratching my head a lot today trying to figure out a way to make it work but it’s simply impossible. The problem is also breaking the exports, the flattened fields appear as `JSON.stringify`'d objects.

I tried a smart field, but nope, returning the id in the `get` function does the same. I suspect flattened fields are handled the same as smart fields under the hood, being simple `get` and `set` functions.

I ended up using my custom library that transforms the query object to query mongodb in my own controllers, but I’d love to be able to rely on the built-ins for such basic things. Quite frustrating.

I’m using the following version: `"forest-express-mongoose": "^8.4.0"`, and just tried with 8.4.4 but the problem still persist.
