# How to show values in (related records from other tables) instead of IDs

**URL:** <https://discourse.cakephp.org/t/how-to-show-values-in-related-records-from-other-tables-instead-of-ids/4212>\
**Category:** Need Help\
**Created:** [April 23, 2018, 10:00pm UTC](https://discourse.cakephp.org/t/how-to-show-values-in-related-records-from-other-tables-instead-of-ids/4212 "2018-04-23T22:00:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://discourse.cakephp.org/u/george)\
**Post date:** [April 23, 2018, 10:00pm UTC](https://discourse.cakephp.org/t/how-to-show-values-in-related-records-from-other-tables-instead-of-ids/4212/1 "2018-04-23T22:00:54Z")

</div>

![11](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/cakephp/original/2X/e/ee68ef25cafe196f16b1b902cded5df9451db4c5.png)  
Greetings,  
i’m new to cakephp, and i used the cake bake with cakphp naming conversion , now in the generated part of related table (like in the photo attached)  
how to display the values instead of IDs in the view.ctp.  
I already set setDisplayedField() in each table class  
ER model :  
Reservation hasMany payement,  
Payments hasMany PaymentMethods  
Reservation hasMany Rooms  
Rooms hasMany FoodPlan  
thanks in advance…

---

<div class="post-metadata">

**Author:** ![kenlaw](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kenlaw/32/868_2.png) [@kenlaw](https://discourse.cakephp.org/u/kenlaw)\
**Post date:** [February 7, 2019, 8:58pm UTC](https://discourse.cakephp.org/t/how-to-show-values-in-related-records-from-other-tables-instead-of-ids/4212/2 "2019-02-07T20:58:58Z")

</div>

In the view you will see a row loop:

Something like: h($variable-\>payment\_method\_id); Change the payment method Id with the column name in the table that calls out the name.

h($variable-\>related table name -\> the column) change the column name from the id column to the column that contains the view name you want displayed. .
