# Portal Filter Another Portal?

**URL:** https://the.fmsoup.org/t/portal-filter-another-portal/3114
**Category:** Questions
**Tags:** layout-design
**Created:** [September 26, 2022, 11:19pm UTC](https://the.fmsoup.org/t/portal-filter-another-portal/3114 "2022-09-26T23:19:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ClarisUSER](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@ClarisUSER](https://the.fmsoup.org/u/ClarisUSER)
#### Post date: [September 26, 2022, 11:19pm UTC](https://the.fmsoup.org/t/portal-filter-another-portal/3114/1 "2022-09-26T23:19:33Z")

</div>

I want a portal that shows all the contacts.  
If you click a contact I want to see a portal of all their invoices.

How Can i Do this?

Would the relationship be Contact ID to CONTACT ID Foreign key?

---

<div class="post-metadata">

### Author: ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)
#### Post date: [September 27, 2022, 12:47am UTC](https://the.fmsoup.org/t/portal-filter-another-portal/3114/2 "2022-09-27T00:47:18Z")

</div>

I think i'd approach it something like this:

1. when you click a portal row, it sets a global field in the current table (or a connected table) with that `Contact ID`. E.g. your global might be `MyTable::SelectedContactID`
2. then you have a relationship like `MyTable::SelectedContactID = InvoiceSelected::CONTACT ID Foreign Key`. Base your invoices portal on that "InvoicesSelected" table occurrence.

So every time you select a row, it changes the selected id and refreshing the Invoices portal will show only those for the selected contact.

---

<div class="post-metadata">

### Author: ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)
#### Post date: [September 27, 2022, 12:50am UTC](https://the.fmsoup.org/t/portal-filter-another-portal/3114/3 "2022-09-27T00:50:11Z")

</div>

Alternatively, if you base your current layout on `Contacts`, then you can use "Current Table" for your contacts portal, and a regular relationship to your related invoices in the layout body (`Contact::id --< Invoice::id_Contact`).
