# Relating two databases with buttons

**URL:** <https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798>\
**Category:** Ask the Community\
**Created:** [September 14, 2022, 1:13am UTC](https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798 "2022-09-14T01:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johanna\_V](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johanna_v/32/29237_2.png) [@Johanna\_V](https://connect.superhuman.com/u/Johanna_V)\
**Post date:** [September 14, 2022, 1:13am UTC](https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798/1 "2022-09-14T01:13:33Z")

</div>

Hi everyone, hoping to get some help on how to use buttons to relate two databases together.

**Table 1 “Contacts”** | **Table 2 “Invoices”**  
Table 1 contains a list of contacts with their information. Table 2 contains invoices received from them. Table 2 does this by pulling the names as a look up from Table 1.

I’d like to go into Table 1 “contacts”, and click on a button which takes me directly to the invoices from that person in table 2 “invoices”.

From what I’ve seen it did not seem possible to do it with 1 button in table 1 only. So far I have managed to get the buttons in table 2 invoices working with a hyperlink that will open a full page of what I need. Works perfectly.

The issue is when I try to get a “Push button” to work in table 1. I need some way to filter it to the name, because right now it tries to open **all** buttons in table 2.

 ![image](https://global.discourse-cdn.com/coda1/original/3X/c/a/ca408496b14677bd9fc873ea62dce5ec66340c1e.png)

I’ve already managed to get the settings so that the buttons only work if there is in fact an invoice available by using the disable if function for the first button in the invoice table 2.

But I cannot seem to find a way to filter button 2 so that it only triggers the buttons for the rows that have the same name in both tables. I think an added difficulty here may be that I used a roll-up for these names.

Any advice?

Hope this was a bit clear.

Thanks

---

<div class="post-metadata">

**Author:** ![Eric\_Shank](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_shank/32/29385_2.png) [@Eric\_Shank](https://connect.superhuman.com/u/Eric_Shank)\
**Post date:** [September 21, 2022, 6:33pm UTC](https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798/2 "2022-09-21T18:33:18Z")

</div>

Not sure you need complicated button behaviors, you can add a column to Contacts that collects all the references from Invoices:

 ![image](https://global.discourse-cdn.com/coda1/original/3X/d/2/d28461cae1216d8195df536c9aebb2f7a87b1b6f.png)

then create a detail View of Contacts and edit the layout to show the list of Invoices as a table:

![image](https://global.discourse-cdn.com/coda1/original/3X/0/2/024c97310d40d0b1813dce2592aa86607f996736.png)

---

<div class="post-metadata">

**Author:** ![Jake\_Nguyen](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jake_nguyen/32/32176_2.png) [@Jake\_Nguyen](https://connect.superhuman.com/u/Jake_Nguyen)\
**Post date:** [September 21, 2022, 7:11pm UTC](https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798/3 "2022-09-21T19:11:16Z")

</div>

Not sure how you are doing a lookup

Coda has more powerful native functions than lookup by name.

In your invoices table, you can create a column with “Contacts” which you can select as a dropdown in any invoice.

In this way you can build this relationship “A contact can have many invoices”

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [December 20, 2022, 7:11pm UTC](https://connect.superhuman.com/t/relating-two-databases-with-buttons/33798/4 "2022-12-20T19:11:23Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
