# Reference field show id when text is set from table

**URL:** <https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920>\
**Category:** Help me!\
**Created:** [December 18, 2023, 10:33am UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920 "2023-12-18T10:33:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![larssbr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/larssbr/32/5289_2.png) [@larssbr](https://community.forestadmin.com/u/larssbr)\
**Post date:** [December 18, 2023, 10:33am UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/1 "2023-12-18T10:33:27Z")

</div>

Hi!

A user showed me a strange bug today regarding reference field. It has been working smoothly, but suddenly today many reference fields displayed the id of the table instead of the name. The user gets confused becouse the ids of the numbers are much harder to understand than the name.

## Feature(s) impacted

Reference field.  
When looking into the problem I also see that the permission tab had turned of many permissions for the role opperations. I toggled them back on again, but it indicates to me that there is a strange bug somehow.

## Observed behavior

## Expected behavior

reference field

 ![Image 2023-12-18 at 11.24.58 AM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/ae3cdf6bc873b20b56822909dc9855ed22e01bc4.jpeg)

it should show the company\_name and not the id in table and other views:

 ![Image 2023-12-18 at 11.25.30 AM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/c/c026e748f4cba41c7f04134c08bb6a28165a7825.jpeg)

## Failure Logs

When I look at the network calls I observe that it looks to get the id as number from the backend and not the company\_name.

 ![Image 2023-12-18 at 11.28.00 AM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/9/96c68cf04d02ca3215872f138cb92606ee66a8ac.jpeg)

## Context

- Project name: FORE
- Team name: AFcode
- Environment name: Production
- Agent (forest package) name & version: 9.3.3
- Database type: Microsoft sql server
- Recent changes made on your end if any: no recent changes before bug was reported.

---

<div class="post-metadata">

**Author:** ![Enki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/enki/32/6004_2.png) [@Enki](https://community.forestadmin.com/u/Enki)\
**Post date:** [December 18, 2023, 11:29am UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/2 "2023-12-18T11:29:56Z")

</div>

Hello @larssbr ,  
If found that vessel owner should refer to the “vesselOwnerId” model, and not “company”, and the vesselOwerId model does not have any reference field set.  
Can you check if that’s the case ?

---

<div class="post-metadata">

**Author:** ![larssbr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/larssbr/32/5289_2.png) [@larssbr](https://community.forestadmin.com/u/larssbr)\
**Post date:** [December 18, 2023, 12:50pm UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/3 "2023-12-18T12:50:22Z")

</div>

Hello @Enki.

That is not the case at was working fine before and that it has this relationship allready.  
Also there is multiple relationshipst that are affected. As in the failure logs above a contractor is a company.  
 ![Image 2023-12-18 at 2.01.05 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/638db5437f8f2d11ede1b838027a9e941d02961d.jpeg)  
My guess is that there is a code change that had side effects.  
Could you look into that?

---

<div class="post-metadata">

**Author:** ![Enki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/enki/32/6004_2.png) [@Enki](https://community.forestadmin.com/u/Enki)\
**Post date:** [December 18, 2023, 3:51pm UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/4 "2023-12-18T15:51:25Z")

</div>

These columns seem unrelated to the “company” model.

The 14/12, a schema has been pushed on your project that did not contain some collections (contractorId, vesselOwner, developerId).  
the customisations linked to these collections has been lost at that time.  
Yesterday, you seem to have fallback to the old schema, recreating these collections.

The layout configuration for these collections need to be recreated manually.

The 2 different schemas that have been pushed come from 2 different agents, with not the same version. There should be only one agent for each environment, maybe check that the environment variables of your agents are well defined, especially the FOREST\_ENV\_SECRET that should be unique to link one agent with one environment.

---

<div class="post-metadata">

**Author:** ![larssbr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/larssbr/32/5289_2.png) [@larssbr](https://community.forestadmin.com/u/larssbr)\
**Post date:** [December 18, 2023, 4:04pm UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/5 "2023-12-18T16:04:46Z")

</div>

Thank you @Enki!

You are correct, to revert that commit solved it 🙈.  
Have a great day and thank you for your help!

---

<div class="post-metadata">

**Author:** ![Enki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/enki/32/6004_2.png) [@Enki](https://community.forestadmin.com/u/Enki)\
**Post date:** [December 18, 2023, 5:41pm UTC](https://community.forestadmin.com/t/reference-field-show-id-when-text-is-set-from-table/6920/6 "2023-12-18T17:41:48Z")

</div>

Glad to help you !

Have a nice evening
