# Displaying records in a portal through 2 joins

**URL:** <https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929>\
**Category:** Classic Servoy\
**Created:** [January 7, 2007, 10:12am UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929 "2007-01-07T10:12:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [January 7, 2007, 10:12am UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929/1 "2007-01-07T10:12:10Z")

</div>

I dont know how to achieve something which i think should be simple.

I have 3 tables:

Login Table (1)  
Consulting Address Table (2)  
Appointment Table (3)

I have defined a global variable for the ID of the customer logged in from table 1.

I now wish to display all the appointments for the customer at all of his consulting addresses, the unique ID of which is stored in table 3.

Effectively i wish to display a portal linking global.userid to AppointmentTable.consultingID via table 2.

Its not as easy as filemaker!!! but i am sure once i have got it, it is much better.

**HELP!**

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [January 7, 2007, 11:18am UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929/2 "2007-01-07T11:18:33Z")

</div>

for more as one relation deep, use tabpanels instead of portals.

tabpanels are just forms, shown in a tabpanel.

You can also create non-stored calculations, that shows data more than one relation deep in a portal, but that is more work.

hope that helps.

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [January 7, 2007, 2:21pm UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929/3 "2007-01-07T14:21:11Z")

</div>

Thanks for that.

Not quite their.

So i create a relationship from my login UserID to my Consulting table

UserID\_to\_consulting\_UserID

I create a form based on the consulting table?

then then create my consulting\_UserID\_to\_Appointment\_User\_ID relationship.

I place a tabpanel on my layout with a form based on the first relationship (UserID\_to\_consulting\_UserID)

and then place a portal on that based on my second relationship?

That gives me all the entries under the first entry found in table 2(consulting addresse), but not the other result from my first relationship.

Sorry, i think i am getting there but still a bit muddled

David

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [January 9, 2007, 1:02pm UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929/4 "2007-01-09T13:02:41Z")

</div>

You need:

1- 3 forms – one for each of your tables

2- 2 relationships: login\_to\_consulting\_address and consulting\_address\_to\_appointment

Design:

1- On the form for the login table place a tab panel that sees the form for the consulting table using the 1st relationship

2- On the form for the consulting address, place a tab panel that sees the form the appointment table through the 2nd relationship.

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [January 9, 2007, 1:23pm UTC](https://forum.servoy.com/t/displaying-records-in-a-portal-through-2-joins/6929/5 "2007-01-09T13:23:29Z")

</div>

Thanks David,

that works a treat, takes a bit to get ones mind around, but work well.

David
