# Making Table Names usable as a Variable Value?

**URL:** <https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802>\
**Category:** Ask the Community\
**Created:** [June 1, 2021, 2:47am UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802 "2021-06-01T02:47:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apurv\_Mittal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/apurv_mittal/32/18381_2.png) [@Apurv\_Mittal](https://connect.superhuman.com/u/Apurv_Mittal)\
**Post date:** [June 1, 2021, 2:47am UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/1 "2021-06-01T02:47:33Z")

</div>

I was trying to create a few tables that have entities flow from one table to another, for example, money flows from one account (whose data is held in one table) to another account (and this account’s data is held in another table). Another example would be a purchase order table notes down the material ordered and a DMTR (Daily Material Transaction Report) table holds data about the material received.

I want to create a connection between the rows between two tables. For example, a row holding data of the purchase order for 500 bags of cement in a Purchase Order table should be linked to the row holding 500 bags received in the DMTR table. In my mind (and I have long ago seen a software do it as well), I see tables represented in entity database mapping kind of diagrams with lines connecting two tables, which on closer zoom/clicking would reveal connections/flows of data from one table to another.

The standard method is to of course create a reference to the table in which data is stored along with the row id (foreign key) of the row holding the connected data.  
A. Is there a better method than creating foreign key pairing?  
B. **To do this, I have to be able to use a table name which would be stored in a column as a variable.** Right now I have scoured through a lot of posts searching for ways to use table names as variables in lookup/filter formulas, but i see that it can only be used if hard coded. Have I missed a way? I am looking to do something like:  
Master Table:

1. currentAccountTable
2. savingsAccountTable
3. purchaseOrderTable
4. dmtrTable

currentAccountTable:

1. “Payment to contractor abc” “50000” “savingsAccountTable” “row4” “outwards entry”
2. “Payment for purchase of Cement” “10000” “purchaseOrderTable” “row1” “outwards entry”

purchaseOrderTable:

1. “Purchase Order to ACC Cement” “10000” “500 bags” “dmtrTable” “row1” “outwards entry”

dmtrTable:

1. “ACC Cement” “500 bags” “Received from ACC” “purchaseOrderTable” “row1” “inwards entry”
2. “ACC Cement” “10 bags” “Given to Contractor ABC” “contractorTable” “row 3” “outwards entry”

There are quite a few challenges that need to be addressed but I will post subsequently my question once I can have this issue resolved one way or another…Right now I am entering all the row ids of the corresponding tables manually (which kind of defeats the point of well… computer science).

My eventual hopes are:

1. To enter/make the connections, I can get search, filter, options of two tables side by side and I get to simply select the row id or at the very least the row to be referenced pops up in a choosable select list
2. This would probably enter data science realm, but i’d hope that there’d be an ability to find out rows which share data automatically and the references get made by themselves.
3. I press a “reconcile” button and all the entries of a table are validated by the down the line connections and “red flags” are raised wherever entry mismatches or lack of flow references are found.

Lol, I know I have put in a big and complicated list of wants in a very simple titled question…hmmm…anyone want to open a company with me? 😛😛

---

<div class="post-metadata">

**Author:** ![Jean\_Pierre\_Traets](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jean_pierre_traets/32/16275_2.png) [@Jean\_Pierre\_Traets](https://connect.superhuman.com/u/Jean_Pierre_Traets)\
**Post date:** [June 1, 2021, 4:46pm UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/2 "2021-06-01T16:46:30Z")

</div>

Dear @Apurv_Mittal, welcome to the community! 🤝

I would say that building your wiki/doc should be possible, but the schema logic needs to be the right fit for your needs and depending on your expectations.

_Would it be possible to share an dummy doc with some sample info and expected outcome (of course manually entered) to get a better understanding what’s about?_

This will make it more easy to create a sample solution with the info provided, but please have in mind that the development will be most likely in steps!

As an example, I received support on a situation that I didn’t find myself a solution"

> [@Build from 2 source bases a new base](https://connect.superhuman.com/t/build-from-2-source-bases-a-new-base/23650):
>
> I am trying to build from two source tables a third table, that holds iterated information of both tables. I should like to accomplish it with selecting from multi select menu’s and pushing a button to generate the third table. I didn’t get it working with “Sequence” and “Nth” in the formula, and it would be great if it could be explained the logic in more detail, thanks in advance. Thanks in advance for your support

_It’s just a small part of some much bigger project I am developing_ 🏗

---

<div class="post-metadata">

**Author:** ![Apurv\_Mittal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/apurv_mittal/32/18381_2.png) [@Apurv\_Mittal](https://connect.superhuman.com/u/Apurv_Mittal)\
**Post date:** [June 26, 2021, 2:57am UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/3 "2021-06-26T02:57:42Z")

</div>

Hi!  
Sorry for the delay in my reply. I was wondering how to mask the financial information in the tables, and then went ahead and simply put in some dummy data.  
Please take a look:

> **[Coda | A new doc for teams.](https://coda.io/signin?continueTo=%2Fd%2FFor-Demo_d82BEku9Md7&errorMessage=VW5hdXRob3JpemVk%3AVGtLb1Q3Ynh3QnFuNW5jYg%3A5JLO1CaJLVOyKVy6J4szs3xPqEGXs_ueVZEKYNBZHL0)**
>
> Coda begins with a blinking cursor and grows as big as your team's ambition. We've seen Coda docs do everything from run weekly meetings, to launch products.

Additionally, over the last few days, I have found that Google Charts (and others) have the ability to model data flow in terms of “Sankey” diagrams. Check it out if you’d ever need to model flow of data like I have been trying here 🙂

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [June 26, 2021, 6:58am UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/4 "2021-06-26T06:58:31Z")

</div>

Hi Apurv,

Welcome to Coda and to the community!

I am a big and growing fan of Coda, but sometimes some things are just done better in a different tool.

I have requested access to your doc - but in the meantime some comments: In this instance I would recommend that you use an accounting tool. I am currently working with a friend for whom I wanted to do some things in Coda. I am now busy implementing Quickbooks for her, and will then use that as a base for accounting, and inventory management, information.

Once that is in place, I will import the information that is needed in Coda from Quickbooks using Zapier.

That allows me to focus on adding value, developing specific things that is not available elsewhere.

Having said that, before I found there is a Zapier between Quickbooks and Coda, I did try some ideas for your scenario in [this document](https://coda.io/@piet-strydom/ap-cycle). I stopped at the stage where I needed to add two GR’s together to match to an invoice.

Regards  
Piet

---

<div class="post-metadata">

**Author:** ![Apurv\_Mittal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/apurv_mittal/32/18381_2.png) [@Apurv\_Mittal](https://connect.superhuman.com/u/Apurv_Mittal)\
**Post date:** [June 30, 2021, 7:06am UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/5 "2021-06-30T07:06:44Z")

</div>

Hi! Thanks so much for your reply! I don’t see a document access request ☹  
I have shared the link to the demo doc I had made in the link above…i’ll try sharing this here again…i have it essentially made it a public doc…

> **[For Demo](https://coda.io/@aipl/for-demo)**

---

<div class="post-metadata">

**Author:** ![Michael\_McGreal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/michael_mcgreal/32/5535_2.png) [@Michael\_McGreal](https://connect.superhuman.com/u/Michael_McGreal)\
**Post date:** [October 12, 2021, 8:59pm UTC](https://connect.superhuman.com/t/making-table-names-usable-as-a-variable-value/23802/6 "2021-10-12T20:59:55Z")

</div>

+1 to TableNames or TableIDs being accessible in formulas!
