# Referenced field shows id, not referenced field

**URL:** <https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997>\
**Category:** Help me!\
**Created:** [January 12, 2022, 4:54am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997 "2022-01-12T04:54:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 12, 2022, 4:54am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/1 "2022-01-12T04:54:34Z")

</div>

## Feature(s) impacted

Reference field

- When a user is referenced, I want to see the field… Name

## Observed behaviour

It used to work, not anymore: it shows the \_id

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 12, 2022, 7:58am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/2 "2022-01-12T07:58:58Z")

</div>

Hello @arnaudambro,

I just try on my side and couldn’t reproduce. 😕

- Does it stop working on a specific collection ? On all collection ?
- Can you double check the Referenced field configuration of the user collection ?
- Can you share your Project Name / Agent Version ?

Best regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 17, 2022, 4:42pm UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/3 "2022-01-17T16:42:17Z")

</div>

Hi Morgan

→ It’s not on every field, neither on every collection. Not even on every environment  
 → I double checked and I think the referenced field is ok  
 → Project Name: Walkie  
 → Agent version:  
“meta”: {  
“liana”: “forest-express-mongoose”,  
“liana\_version”: “8.4.3”,  
“stack”: {  
“database\_type”: “MongoDB”,  
“engine”: “nodejs”,  
“engine\_version”: “12.18.3”,  
“orm\_version”: “5.13.12”  
}  
}

Would be a great help if you find out !

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 19, 2022, 8:41am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/4 "2022-01-19T08:41:53Z")

</div>

one more things: it’s only in list view.  
when I click on an item, then it’s properly displayed.  
but on a list view, the id is displayed instead of the references field

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 19, 2022, 9:04am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/5 "2022-01-19T09:04:07Z")

</div>

Hello @arnaudambro,

> [@arnaudambro](#):
>
> one more things: it’s only in list view.  
> when I click on an item, then it’s properly displayed.  
> but on a list view, the id is displayed instead of the references field

Thanks for sharing all those information. We will try to reproduce this behavior.

Just a last question, can you check the widget you’re using on this field ?

Thanks in advance for your time. 🙏

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 19, 2022, 9:47am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/6 "2022-01-19T09:47:34Z")

</div>

![Screen Shot 2022-01-19 at 10.46.54](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/fe4ba363492604ba68cb880fe830c970eabf1aa5.png)  
do you mean this ?

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 19, 2022, 9:54am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/7 "2022-01-19T09:54:11Z")

</div>

That’s it. So this is the buggy one ?

So the child field should show the referenced field defined in the referenced collection.

Can you share the your schema/mongoose definition for this collection ? (We should see that child is a Ref to something)

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 19, 2022, 10:10am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/8 "2022-01-19T10:10:40Z")

</div>

> [@arnaudambro](#):
>
> → It’s not on every field, neither on every collection. Not even on every environment

On which environment are you experiencing it ?

I’m trying to gaver as much information as we can to reproduce the issue on our side. 🙏

Regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 19, 2022, 10:15am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/9 "2022-01-19T10:15:46Z")

</div>

They are all buggy actually, not only this one.  
It was not buggy a few weeks ago, but it’s buggy now, only on list view, not on details/summary view.  
It’s not even buggy in Development (local) mode, only in Production.  
The schema never changed, it looks like

```javascript

module.exports = (mongoose, Mongoose) => {
  const Schema = Mongoose.Schema({
    user: { type: Mongoose.Schema.Types.ObjectId, ref: 'User' },
    child: { type: Mongoose.Schema.Types.ObjectId, ref: 'Child' },

```

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 19, 2022, 10:16am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/10 "2022-01-19T10:16:43Z")

</div>

I tried to `Copy layout configuration` from development to production, but it didn’t change a thing

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 20, 2022, 9:43am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/11 "2022-01-20T09:43:16Z")

</div>

Hey @arnaudambro,

> [@arnaudambro](#):
>
> It’s not even buggy in Development (local) mode, only in Production.

I just check your config. Your production uses the `forest-express-mongoose 8.5.0` and your development uses `forest-express-mongoose 8.4.3`.

Could you try to use the same version on both environments ?

> [@arnaudambro](#):
>
> I tried to `Copy layout configuration` from development to production, but it didn’t change a thing

Could you push the latest _forest-admin-schema_ (generated in development) to your production environment ? I’m wondering if it could have been changed by someone that introduced the issue.

Let me know if it resolve the issue.

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![arnaudambro](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaudambro/32/1480_2.png) [@arnaudambro](https://community.forestadmin.com/u/arnaudambro)\
**Post date:** [January 20, 2022, 10:54am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/12 "2022-01-20T10:54:23Z")

</div>

Hi Morgan

We forced the 8.4.3 everywhere, and now it works good.  
Is it a problem with 8.5.0 ? Or is it just incompatibility with config files between different versions ?

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [January 20, 2022, 11:06am UTC](https://community.forestadmin.com/t/referenced-field-shows-id-not-referenced-field/3997/13 "2022-01-20T11:06:05Z")

</div>

Hey @arnaudambro,

> [@arnaudambro](#):
>
> We forced the 8.4.3 everywhere, and now it works good.

Perfect. 👌

> [@arnaudambro](#):
>
> Is it a problem with 8.5.0 ? Or is it just incompatibility with config files between different versions ?

You should always have an _forest-admin-schema_ generated with the same forest-express-mongoose version.

The basic workflow is you need to work on development environment, once your happy with what you have added you push your changes to production (using you favorite version control system a.k.a git). This way your code base, dependencies and the _forest-admin-schema_ (only generated in development) are always coherent.

Let me know if you need more information. Maybe our documentation lacks some information on this topic (actually we are working on making it better with a brand new version).

Kind regards,  
Morgan
